bug: Cursor flickering in cmdline
Did you check docs and existing issues?
- [X] I have read all the noice.nvim docs
- [X] I have updated the plugin to the latest version before submitting this issue
- [X] I have searched the existing issues of noice.nvim
- [X] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.10.1
Operating system/version
Linux 6.6.41
Describe the bug
Cusor flickers in cmdline with "g/pattern" commands or "q:" command-line window open.
Steps To Reproduce
- Open neovim with minimal init.
- Ensure noice.nvim is installed and running.
- Press
:g/a. - Cursor begins to flicker.
Expected Behavior
Cursor does not flicker.
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = { "MunifTanjim/nui.nvim" },
opts = {
cmdline = {
view = "cmdline",
},
},
}
},
})
Probably related to #923. The workaround of downgrading to 4.4.7 also worked for this issue.
i have the same problem on windows terminal using PowerShell
https://www.reddit.com/r/neovim/comments/1ewaq2u/comment/liy9hsu/?context=3 Same in my clean LazyVim instalation.
Ok, glad I'm not the only one noticing this. Same for NvChad with clean install
same here
same here
https://github.com/user-attachments/assets/f08b102b-92fb-44e3-89b7-e43d08d6f1b7
presenting the same problem
unlike top video, mine starts exactly as i go to the bar
Same for me: neovim 10.1, macos
Same here, on Wezterm on windows and WSL
Does this block of code need to call nvim__redraw(flush = true)? I think that's the main reason for the flickering, based on my initial analysis based on the Neovide logs here https://github.com/neovide/neovide/issues/2735#issuecomment-2254256173
From the UI perspective a flush means that there's a valid UI state that should be shown. But here it's first flushing with a mouse movement and then move the mouse again.
vim.schedule_wrap(function()
if not Util.is_search() then
if vim.api.nvim__redraw then
vim.api.nvim__redraw({ flush = true, cursor = true })
else
vim.cmd.redraw()
end
end
Cmdline.fix_cursor()
end)
end
@fredizzimo nope, that was indeed wrong! Did a bad copy-paste from the cmdline code and forgot to remove the cursor = true.
Just pushed a new release, so should be fixed.
Weirdly enough the issue didn't show on Linux, but it did on Windows, MacOS and in Neovide.
Can confirm its fixed. Tyvm @folke @fredizzimo ❤️
Thank you @folke, I can confirm it is fixed on macos + neovim 👍
It was really painful to use cmdline with the flickering cursor.