[X] I have searched the existing issues of flash.nvim
[X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
v0.9.5
Operating system/version
MacOS 14.5
Describe the bug
Error description: When trying to use flash inside the command line window, this error happens:
E5108: Error executing lua: ...o/.local/share/nvim/lazy/flash.nvim/lua/flash/prompt.lua:51: E11: Invalid in command-line window; <CR> executes, CTRL-C quits
stack traceback:
[C]: in function 'nvim_win_close'
...o/.local/share/nvim/lazy/flash.nvim/lua/flash/prompt.lua:51: in function 'hide'
...lo/.local/share/nvim/lazy/flash.nvim/lua/flash/state.lua:417: in function 'loop'
....local/share/nvim/lazy/flash.nvim/lua/flash/commands.lua:9: in function 'jump'
Steps To Reproduce
open the command line window
start flash and search for something
accept some label
see the error message
press enter to quit it
cursor won't have moved
Expected Behavior
should move cursor to expected position, and not error.
Repro
-- DO NOT change the paths and don't remove the colorscheme
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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{ "folke/flash.nvim", opts = {} },
{
"folke/flash.nvim",
event = "VeryLazy",
opts = {
modes = {
search = {
enabled = false
},
},
},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
}
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Did you check docs and existing issues?
Neovim version (nvim -v)
v0.9.5
Operating system/version
MacOS 14.5
Describe the bug
Error description: When trying to use flash inside the command line window, this error happens:
Steps To Reproduce
Expected Behavior
should move cursor to expected position, and not error.
Repro