stevearc / dressing.nvim

Neovim plugin to improve the default vim.ui interfaces
MIT License
1.69k stars 32 forks source link

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

Closed DrKGD closed 6 months ago

DrKGD commented 6 months ago

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

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 :disappointed:

stevearc commented 6 months ago

Should be fixed