smoka7 / hop.nvim

Neovim motions on speed!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Calling any Hop command on an empty line with folke/noice.nvim installed causes the cursor to turn black

j-barnak opened this issue · comments

Describe the bug
When you call any hop command on an empty line with noice installed, the cursor turns black. This is true with all color schemes.

I have tried

vim.cmd("highlight! link NoiceCursor Cursor")

But this doesn't fix anything.

To Reproduce

  1. Create an empty line
  2. Put cursor on empty line
  3. <cmd>HopChar1AC<cr>
-- 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 hop.nvim
        local plugins = {
          { "smoka7/hop.nvim", opts = {} },
          {"folke/noice.nvim", opts = {} },
        }
        require("lazy").setup(plugins,{})

Expected behavior
I expect the cursor to remain the same color.

Screenshots
With noice enabled

With noice disabled

version (please complete the following information):

  • Nvim version: NVIM v0.9.1
  • hop.nvim version: "hop.nvim": { "branch": "master", "commit": "5681edd36cf858c821826178e77af78463c1c281" }
commented

I've seen this issue reported folke/noice.nvim#566 and folke/noice.nvim#585 but I had no luck reproducing it.
Does the pr fixes it for you?
nvim hides the cursor when it's waiting for user to input a char with getcharstr, and hop creates a temp vrtual cursor meanwhile.

local function add_virt_cur(ns)

Does the cursor stays black even after the hop finishes it job? Hop doesn't change cursor highlighting anywhere.

Getting rid of add_virt_cur fixes it! Thanks!