You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2025. It is now read-only.
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" selectionsbackend= { "nui" },
nui= {
min_height=0,
},
},
input= {
-- Allow escaping to normal mode inside inputsinsert_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")
Screenshots
This is the behaviour without dressing.nvim btw:
The text was updated successfully, but these errors were encountered:
AlexJF
changed the title
Race condition with concurrent selections in default telescope and builtin backends
Race condition with concurrent selections in telescope and builtin backends
Jan 19, 2024
AlexJF
changed the title
Race condition with concurrent selections in telescope and builtin backends
Race with concurrent selections in telescope and builtin backends
Jan 19, 2024
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:The text was updated successfully, but these errors were encountered: