Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nui vim.ui.select callback is called twice, #131

Closed
DrKGD opened this issue Dec 14, 2023 · 1 comment
Closed

nui vim.ui.select callback is called twice, #131

DrKGD opened this issue Dec 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working P0 Highest priority, will receive attention

Comments

@DrKGD
Copy link

DrKGD commented Dec 14, 2023

Describe the bug
NUI vim.ui.select callback is called twice, once for "on_close" and once for "on_submit", not sure if that has always been the case but I just happened to discover it.

NUI Integration in dressing.nvim

System information

  • OS: Arch Linux
  • Neovim version: NVIM v0.10.0-dev-1840+g97bea3163a
  • Is this related to a specific vim.ui.select backend? If so, which one? NUI
  • Dressing config:
require('dressing').setup {
  select = {
    backend = { "nui", "fzf_lua", "builtin" },
  }
}

Of course, thats the MRE for me, using lazy.nvim, without lazy loading.

To Reproduce
Steps to reproduce the behavior:

  1. Run the following
    :lua vim.ui.select({'a','b'}, { prompt = 'test' }, function(input) print(input) end)
  2. Either cancel with Esc, or confirm any of its values, should report both the value itself and an extra nil

image

By commenting out on_close, nui integration works as intended, not sure if that bring any side effects into the mix 😞

@DrKGD DrKGD added the bug Something isn't working label Dec 14, 2023
@stevearc stevearc added the P0 Highest priority, will receive attention label Dec 24, 2023
@stevearc
Copy link
Owner

Should be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Highest priority, will receive attention
Projects
None yet
Development

No branches or pull requests

2 participants