Describe the bug
Some situations may lead to multiple selection prompts happening concurrently. For instance when using the vtsls LSP and opening a typescript project we get these 2 prompts at startup:
These show up as expected when using the nui backend but when using the default telescope backend, only one of them will show up. The LSP will continue showing as loading until it eventually times out on the selection.
When using the builtin backend, an error shows up "window was closed immediately" and the selection seems to get immediately cancelled. A single select UI still shows up but selecting it seems to not have any effect.
Is this related to a specific vim.ui.select backend? If so, which one? telescope and builtin
Dressing config:
return {
"stevearc/dressing.nvim",
-- dir = "~/Projects/dressing.nvim",
enabled = true,
opts = {
select = {
enabled = true,
-- default telescope backend seems to not support "concurrent" selections
backend = { "nui" },
nui = {
min_height = 0,
},
},
input = {
-- Allow escaping to normal mode inside inputs
insert_only = false,
},
},
}
To Reproduce
Steps to reproduce the behavior:
We can easily reproduce this behaviour using the select test file in tests/manual/select.lua by adding a second run test call:
-- Run this test with :source %
local function run_test(backend)
local config = require("dressing.config")
local prev_backend = config.select.backend
config.select.backend = backend
vim.ui.select({ "first", "second", "third" }, {
prompt = "Make selection: ",
kind = "test",
}, function(item, lnum)
if item and lnum then
vim.notify(string.format("selected '%s' (idx %d)", item, lnum), vim.log.levels.INFO)
else
vim.notify("Selection canceled", vim.log.levels.INFO)
end
config.select.backend = prev_backend
end)
end
-- Replace this with the desired backend to test
run_test("telescope")
run_test("telescope")
Describe the bug Some situations may lead to multiple selection prompts happening concurrently. For instance when using the
vtsls
LSP and opening a typescript project we get these 2 prompts at startup:These show up as expected when using the
nui
backend but when using the defaulttelescope
backend, only one of them will show up. The LSP will continue showing as loading until it eventually times out on the selection.When using the
builtin
backend, an error shows up "window was closed immediately" and the selection seems to get immediately cancelled. A single select UI still shows up but selecting it seems to not have any effect.System information
OS: [mac]
Neovim version:
Is this related to a specific
vim.ui.select
backend? If so, which one?telescope
andbuiltin
Dressing config:
To Reproduce Steps to reproduce the behavior:
tests/manual/select.lua
by adding a second run test call:Screenshots
This is the behaviour without
dressing.nvim
btw: