noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

bug: Cursor flickering in cmdline

Open TommyCox opened this issue 1 year ago • 10 comments

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

  1. Open neovim with minimal init.
  2. Ensure noice.nvim is installed and running.
  3. Press :g/a.
  4. 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",
        },
      },
    }
  },
})

TommyCox avatar Aug 13 '24 01:08 TommyCox

Probably related to #923. The workaround of downgrading to 4.4.7 also worked for this issue.

TommyCox avatar Aug 13 '24 01:08 TommyCox

i have the same problem on windows terminal using PowerShell

Nemexia avatar Aug 20 '24 16:08 Nemexia

https://www.reddit.com/r/neovim/comments/1ewaq2u/comment/liy9hsu/?context=3 Same in my clean LazyVim instalation.

mkubasz avatar Aug 20 '24 17:08 mkubasz

Ok, glad I'm not the only one noticing this. Same for NvChad with clean install

cjasaMHC avatar Aug 21 '24 22:08 cjasaMHC

same here

panboo0106 avatar Aug 23 '24 07:08 panboo0106

same here

iamxiaojianzheng avatar Aug 30 '24 03:08 iamxiaojianzheng

https://github.com/user-attachments/assets/f08b102b-92fb-44e3-89b7-e43d08d6f1b7

presenting the same problem

renxzen avatar Sep 01 '24 05:09 renxzen

unlike top video, mine starts exactly as i go to the bar

Nemexia avatar Sep 01 '24 19:09 Nemexia

Same here, also on Windows Terminal Powershell

#935

azaidrahman avatar Sep 03 '24 03:09 azaidrahman

Same for me: neovim 10.1, macos

Riddlerrr avatar Sep 07 '24 19:09 Riddlerrr

Same here, on Wezterm on windows and WSL

echaya avatar Sep 09 '24 14:09 echaya

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 avatar Sep 18 '24 08:09 fredizzimo

@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.

folke avatar Sep 18 '24 18:09 folke

Can confirm its fixed. Tyvm @folke @fredizzimo ❤️

MarcoBuess avatar Sep 18 '24 19:09 MarcoBuess

Thank you @folke, I can confirm it is fixed on macos + neovim 👍

It was really painful to use cmdline with the flickering cursor.

Riddlerrr avatar Sep 19 '24 08:09 Riddlerrr