bug(picker): `ui_select` integration has bugs when multiple selections happen in succession
Did you check docs and existing issues?
- [x] I have read all the snacks.nvim docs
- [x] I have updated the plugin to the latest version before submitting this issue
- [x] I have searched the existing issues of snacks.nvim
- [x] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
NVIM v0.11.0-dev-1971+g092529ebbf (also tested with stable 0.10.4)
Operating system/version
Arch Linux
Describe the bug
When interacting with some vim.ui.select prompts the snacks.picker implementation clobbers the interactions if they happen in succession. I have found an extremely reproducible case with Neogit and am using that as an example.
Steps To Reproduce
nvim -u repro.lua, open the minimal reproducing configuration:cd some/git/path, change directories to a git repository:Neogit, open Neogitdr, do the keyboard command for doing a diff range (this leads to 3vim.ui.selectcalls in succession)<CR>, Make a selection from the first selection- See that nothing happens and the future selections are clobbered
A good test is to remove snacks from the repro.lua and redo the steps and see that you get more selections after the first one.
Expected Behavior
The snacks.picker for ui_select should work properly in all cases where vim.ui.select works by default.
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system "curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua")()
require("lazy.minit").repro {
spec = {
{ -- Add neogit as this has a case where this happens
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
},
opts = {},
},
{ -- add snacks and enable the `ui_select` for picker
"folke/snacks.nvim",
lazy = false,
priority = 1000,
opts = {
picker = { ui_select = true },
},
},
},
}
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This isn't stale. It is still an issue
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This isn't stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Still not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Not stale
Just tested and it all works fine for me.
I did fix a million issues over the last two days, so this may have been fixed.