[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.10.0-dev-2534+g25124d360
Operating system/version
MacOS 14
Describe the bug
I was able to replicate with the given minimal repro.lua
When using "/" to search with flash installed, if I press Enter to jump to the first match, everything works as expected. However, if I use the Label to jump instead, then my cursor first snaps back to its original location in the buffer, then forward to the Label. This will scroll the screen if the cursor jump is large enough.
If I use the "s" or "f" flash keybind from LazyVim, then this cursor jumping doesn't happen. And again, if I use Enter to hit the first match, rather than the label, no cursor jump occurs.
I've attached a video using the minimal repro.lua config. The flashes are quite quick here, but you can notice them. In my full LazyVim installation, its much easier to see that the cursor is actually jumping, probably because the plugins slow things down.
Similarly, it doesn't happen in the minimal repo when the buffer is small (<300 LoC), or the window height itself is small. Probably just quick rendering covering it up.
Insert >300 lines of code, maybe more depending on your computer's specs.
Make the window full height
Search using "/" and match by selecting a Label identifier.
Expected Behavior
No (visible) cursor jumping. If jumping via Enter has no issues, then I don't think flash.nvim should either.
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 = {} },
-- 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.10.0-dev-2534+g25124d360
Operating system/version
MacOS 14
Describe the bug
I was able to replicate with the given minimal repro.lua
When using "/" to search with flash installed, if I press Enter to jump to the first match, everything works as expected. However, if I use the Label to jump instead, then my cursor first snaps back to its original location in the buffer, then forward to the Label. This will scroll the screen if the cursor jump is large enough.
If I use the "s" or "f" flash keybind from LazyVim, then this cursor jumping doesn't happen. And again, if I use Enter to hit the first match, rather than the label, no cursor jump occurs.
I've attached a video using the minimal repro.lua config. The flashes are quite quick here, but you can notice them. In my full LazyVim installation, its much easier to see that the cursor is actually jumping, probably because the plugins slow things down.
Similarly, it doesn't happen in the minimal repo when the buffer is small (<300 LoC), or the window height itself is small. Probably just quick rendering covering it up.
https://github.com/folke/flash.nvim/assets/16358780/241a603b-3db4-45df-a5a8-32a72eb15b72
Steps To Reproduce
Expected Behavior
No (visible) cursor jumping. If jumping via Enter has no issues, then I don't think flash.nvim should either.
Repro