Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
j-barnak opened this issue Sep 12, 2023 · 2 comments

Comments

@j-barnak
Copy link

j-barnak commented Sep 12, 2023

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" }
@smoka7
Copy link
Owner

smoka7 commented Sep 12, 2023

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.

@j-barnak
Copy link
Author

Getting rid of add_virt_cur fixes it! Thanks!

@smoka7 smoka7 closed this as completed Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants