folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
Apache License 2.0
4.48k stars 105 forks source link

bug: cursor flicker in cmdline #953

Open polirritmico opened 1 month ago

polirritmico commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.1 Build type: Release LuaJIT 2.1.1716656478

Operating system/version

Linux 6.6.52-gentoo

Describe the bug

Hi. This is probably the same problem as #931, but I'm opening a new issue because that fix (c1ba80ccf6b3bd8c7fc88fe2e61085131d44ad65) seems to be working for some users.

The cursor flickering occurs when searching with /. It's easier to trigger it on large files and windows, so I've added an htm test case to download in the repro script.

Reverting to 4.4.7 fixes the flickering completely.

Steps To Reproduce

  1. nvim -u repro.lua
  2. Press /e (search character e)
  3. Cursor begins to flicker on the command-line.
  4. If not, try with a bigger window and a smaller font size.

Expected Behavior

No cursor flickering

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",
    -- version = "4.4.7", -- lattest version without flicker
    event = "VeryLazy",
    dependencies = { "MunifTanjim/nui.nvim" },
    opts = {
      cmdline = { enabled = false },
      messages = { enabled = false },
    },
  },
})

if not vim.loop.fs_stat("11-h.htm") then
  vim.notify("Downloading test case...")
  vim.fn.system("wget https://www.gutenberg.org/files/11/11-h/11-h.htm")
end

vim.cmd("edit 11-h.htm")
polirritmico commented 1 month ago

Still present with 4.5.2 and NVIM v0.10.2 Build type: Release LuaJIT 2.1.1716656478.

dpetka2001 commented 1 month ago

I can't reproduce this with the / for searching in my case, but I can reproduce the flickering when doing :g/some_pattern/.

polirritmico commented 1 month ago

I can't reproduce this with the / for searching in my case, but I can reproduce the flickering when doing :g/some_pattern/.

By "your case," do you mean that you didn't follow the provided reproduction steps, or that you did follow them but couldn't reproduce the issue? Either way, I've tested it further, and indeed, :g/e/ also triggers the flickering.

In case it's relevant, this doesn't seem related to a particular terminal. I could reproduce it in Konsole, Kitty, and WezTerm.

dpetka2001 commented 1 month ago

I did /treesitter and /function to search for treesitter and function and both worked without flickering. Only the :g/patterncauses flickering for me.

bartels commented 1 month ago

I can confirm this happens for me with the above config. Searching with / causes the flickering in cmdline.

Also, with set wildmode=list (thus not using popupmenu) and trying to complete in the cmdline (e.g. type :e followed by TAB to get a completion list), the list appears very briefly and then disappears, making list completions unusable.

Both of the above work correctly after reverting to 4.4.7

ignamartinoli commented 5 days ago

For me it happens when I'm doing substitution with parenthesis like :%s/\(something\)/\1 else/g.

Tom94 commented 4 days ago

I encounter the same issue.

4.4.7: https://github.com/user-attachments/assets/a26fa179-d55b-4f45-9f2c-0b57cc93a903

4.5.0 and higher: https://github.com/user-attachments/assets/18226877-b108-4050-ae3b-f8bdf2dad09e

Curiously, this flickering still happens, even when I disable all features of noice and simply set cmdheight=0 with the noice plugin loaded.