Closed WizardStark closed 6 months ago
Interesting, I am able to reproduce, and weirdly, after adding some debug logs, it is executing properly all the way up to the vim.ui.select
line (I added a debug line directly above vim.ui.select
which does run) and then it appears that vim.ui.select
just... does nothing?
Possibly Neovim bug? Let's see if we can reproduce with a different vim.ui.select
handler like mini.pick
or fzf-lua
Using mini.pick or fzf-lua I am not able to reproduce this behaviour - the window opened by either plugin closes as expected when clicking outside of it.
Super strange that this only happens with Telescope + legendary, I tried all builtin telescope pickers and was not able to break it.
minimal init.lua for swapping between all 3:
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
-- do not remove the colorscheme! it makes testing nicer
"folke/tokyonight.nvim",
{
"mrjones2014/legendary.nvim",
dependencies = {
-- {
-- "echasnovski/mini.pick",
-- version = "*",
-- config = function()
-- vim.ui.select = require("mini.pick").ui_select
-- end,
-- },
-- {
-- "ibhagwan/fzf-lua",
-- config = function()
-- require("fzf-lua").register_ui_select()
-- end,
-- },
{ "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
{ "stevearc/dressing.nvim", opts = {} },
},
},
-- add any other pugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
require("legendary").setup({
-- add any options here
})
-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme! it makes testing nicer
vim.cmd([[colorscheme tokyonight]])
Confirmed that this is a bug in the dressing code, at least for the telescope select implementation.
Any logging in this method is hit while the legendary select ui is functioning as normal, but is absent after breaking.
Just for interests sake I also used fzf-lua + dressing, which does not break - so narrowed down to the dressing telescope select implementation.
Created issue https://github.com/stevearc/dressing.nvim/issues/150, feel free to close this!
Similar Issues
Neovim Version
Steps to Reproduce
Expected Behavior
Finder opens as normal
Actual Behavior
No finder window appears, although legendary logs report normal behaviour.
Minimal Configuration to Reproduce
Output from :LegendaryLog
``` [Tue 16 Apr 09:23:03 2024][legendary.nvim] Took 2.026875 ms to filter items in context. [Tue 16 Apr 09:23:03 2024][legendary.nvim] Config.sort.frecency is enabled, but sqlite is not available or database could not be opened, frecency is automatically disabled. [Tue 16 Apr 09:22:57 2024][legendary.nvim] Took 2.055083 ms to filter items in context. [Tue 16 Apr 09:22:57 2024][legendary.nvim] Config.sort.frecency is enabled, but sqlite is not available or database could not be opened, frecency is automatically disabled. [Tue 16 Apr 09:22:54 2024][legendary.nvim] setup() parsed and applied all configuration. ```:LegendaryLog
output (click to expand)The second call here at 09:23:03 did not open any finder
Additional Details and/or Screenshots
Triple clicking may seem excessive - in my own config though it is only a single click (which often occurs when just refocusing the nvim window).
I also find this very strange as any telescope window handles this gracefully, and legendary just uses the vim.ui.select implementation of your choice.