folke / noice.nvim

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

bug: Cursor jumps in cmdline - 4.5.0 #923

Open xbladesub opened 1 month ago

xbladesub commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.1 Release

Operating system/version

MacOS 14.5

Describe the bug

Open cmdline - cursor jumps by itself

Steps To Reproduce

open cmdline

check cursor:

https://github.com/user-attachments/assets/336d6bf1-a9d4-417a-a304-7bbea89ecf0d

Expected Behavior

Expected cursor doesn't jump

https://github.com/neovide/neovide/issues/2735#issuecomment-2254256173

Repro

No response

chrisgrieser commented 1 month ago

Have the same issue. Can repro with this minimal config + using neovide:

local spec = {
    {
        "folke/noice.nvim",
        dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" },
        opts = true,
    },
}
--------------------------------------------------------------------------------
vim.env.LAZY_STDPATH = "/tmp/nvim-repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro { spec = spec }

Problem does not occur with version 4.4.7 of noice.

SuXYIO commented 1 month ago

Same issue.

JustBarnt commented 1 month ago

Same issue here. I just reverted back to V4.4.7 until Folke returns from his vacation :)

johnend commented 1 month ago

Yep, flickering also visible in terminal (using Wezterm). Everything still works fine but is a little off-putting.

GitMurf commented 1 month ago

I can confirm that with cmdline with noice I get the constant flicker of the cursor in the cmdline box but Search (which has the box in same location) does NOT have the flicker.

As others said above, downgrading to v4.4.7 fixed it for me.

augustocdias commented 1 month ago

For me it only happens when I have more than 1 tab open. It also happens on 4.4.7

leaysgur commented 1 month ago

Same here but without using Neovide.(macOS, WezTerm, Nvim0.10.1)

In my case, disable vim.o.autochdir fixes blinking. 🤔

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
    local lazyrepo = "https://github.com/folke/lazy.nvim.git"
    vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
end
vim.opt.rtp:prepend(lazypath)

vim.g.mapleader = " "
vim.g.maplocalleader = "\\"

-- ⁉️
vim.o.autochdir = true

require("lazy").setup({
    {
        "folke/noice.nvim",
        -- Workaround...
        -- version = "4.4.7",
        dependencies = { "MunifTanjim/nui.nvim" },
        opts = {},
        event = "VeryLazy",
    },
})
thohnb commented 1 month ago

Thanks you ! I have same error, but when downgrade to 4.4.7 it fixed it

sebastianzehner commented 1 month ago

When I open the Cmdline popup there are two cursors visible. One in the document and one in the Cmdline popup. They both flashing as wild and than I downgraded to version 4.4.7. It fixed it. The cursor in the document is now not visible and the cursor in the Cmdline popup is not flashing. Perfect and thank you! Maybe the next update will fix this issue?

sineptic commented 1 month ago

I open VERY similar issue for notify plugin. We discover that if in notify config set stages="static" this problem doesn't occurs. Is there some similar options for noice? This problem like other, that I mentioned (for me) occurs in zellij, but without it works fine.

Vortigern-The-Grey commented 4 weeks ago

From my testing, this issue only occurs on Windows Terminal in specific. Afaik, Tabby, Hyper and Alacritty on windows all are fine, and don't suffer from this issue.

emretuna commented 4 weeks ago

OS: Mac Terminal: Wezterm moving to 4.4.7 fixed the issue for me too.

sineptic commented 4 weeks ago

Alacritty on windows all are fine, and don't suffer from this issue.

With Alacritty on Linux I have problem. And even with all "view" options, except virtualtext(lol).

BElluu commented 4 weeks ago

I have similar effect on Windows 10 - look at mentioned issue about blinking cursor. On Linux(Ubuntu or NixOS) everything is ok.

Vortigern-The-Grey commented 3 weeks ago

Pretty sure this is caused by commit 1698725.

dinhlongviolin1 commented 2 weeks ago

I reverted to 4.4.7 from 4.5.0. No more flickering. Hope this will be fixed soon!

piz-ewing commented 2 weeks ago

Pretty sure this is caused by commit 1698725.

I’ve read and tried to fix it (#937 ), but I’m not sure if it works for others.

vricop commented 1 week ago

I open VERY similar issue for notify plugin. We discover that if in notify config set stages="static" this problem doesn't occurs. Is there some similar options for noice? This problem like other, that I mentioned (for me) occurs in zellij, but without it works fine.

Confirmed, it happens under zellij. If I open neovim normally it works fine.

I doesn't matter if I use v 4.4.7 or the latest version. I'm also convinced it has something to do with nvim-notify. If I delete nvim-notify as a dependency the bug is gone.

vricop commented 1 week ago

As others pointed out, some users are reporting the same bug in nvim-notify. I’ll try to apply the workaround suggested in their issues. If it does work I’ll let you know.

JustBarnt commented 1 week ago

Hmmm. Interesting that a change in here brings out a bug that exists in nvim-notify. I'll update to 4.5.0 again as well and disable nvim-notify and see if I can get the same results as well on Windows.

vricop commented 1 week ago

Hmmm. Interesting that a change in here brings out a bug that exists in nvim-notify. I'll update to 4.5.0 again as well and disable nvim-notify and see if I can get the same results as well on Windows.

It’s probably the zellij + nvim-notify combo causing it.

I’m going to test it this eve

vricop commented 1 week ago

Got it working!

Note: I ended up splitting the config for noice & nvim-notifiy for convenience. Make sure you don't copy/paste the enabled_plugins. That's how I enable/disable plugins from a single file that contains _G.enabled_plugin table variable.

-- Noice config
return {
  'folke/noice.nvim',
  event = 'VeryLazy',
  enabled = enable_plugins.noice,
  dependencies = { 'MunifTanjim/nui.nvim' },
  opts = {
    cmdline = {
      format = {
        cmdline = {
          icon = [[ ]],
        },
        search_down = {
          icon = [[ 󰶡]],
        },
        search_up = {
          icon = [[ 󰶣]],
        },
        help = {
          icon = [[󰋗 ]],
        },
      },
    },
  },
}
-- Notify config
return {
  'rcarriga/nvim-notify',
  enabled = enable_plugins.notify,
  opts = {
    -- `static` fixes cursor flickering
    stages = 'static',
    icons = {
      ERROR = [[ ]],
      WARN = [[ ]],
      INFO = [[ ]],
      BUG = [[ ]]
    },
  },
}
JustBarnt commented 1 week ago

Hm. I'm not sure it's only Zellij it could have its own underlying issue that isn't playing nicely in general, because I disabled nvim-notify and updated noice back to v4.5.0 and I still get the flickering. Both in Wezterm, Windows terminal and Neovide. It's weird that for Mac Users it seems to be an issue with nvim-notify though.

vricop commented 1 week ago

Hm. I'm not sure it's only Zellij it could have its own underlying issue that isn't playing nicely in general, because I disabled nvim-notify and updated noice back to v4.5.0 and I still get the flickering. Both in Wezterm, Windows terminal and Neovide. It's weird that for Mac Users it seems to be an issue with nvim-notify though.

Neovide? have you tried from the terminal? just in case...

JustBarnt commented 1 week ago

@vricop Yea, I have that was why I had mentioned I still saw the issue without nvim-notify in Wezterm and Windows terminal as well.

vricop commented 1 week ago

Hm. I'm not sure it's only Zellij it could have its own underlying issue that isn't playing nicely in general, because I disabled nvim-notify and updated noice back to v4.5.0 and I still get the flickering. Both in Wezterm, Windows terminal and Neovide. It's weird that for Mac Users it seems to be an issue with nvim-notify though.

That's weird!

vricop commented 1 week ago

Today I find out the cursor is still jumping. With a different (less annoying) behavior.

And again only inside zellij. I’ll just disable nvim-notify by now.

vricop commented 1 week ago

Some tmux users are reporting the same bug in nvim-notify issues.

Vortigern-The-Grey commented 1 week ago

Until Folke gets back, I could fork noice.nvim and roll back 1698725.

vricop commented 1 week ago

Pretty sure this is caused by commit 1698725.

Wouldn’t be easier to config lazy package manager to install the plugin with the commit hash prior to the commit with the breaking change? d9328ef

jsonMartin commented 6 days ago

Pretty sure this is caused by commit 1698725.

Wouldn’t be easier to config lazy package manager to install the plugin with the commit hash prior to the commit with the breaking change? d9328ef

Thanks for this suggestion. Doing this fixed this flickering issue I'm also having with iTerm2, zellij, and LazyVim.

Here's the code working snippet for LazyVim I added to ~/.config/nvim/lua/plugins/plugins.lua

{
    "folke/noice.nvim",
    commit = "d9328ef",
},