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

Problems with cursor highlight #27

Open
sQVe opened this issue Jul 7, 2022 · 10 comments
Open

Problems with cursor highlight #27

sQVe opened this issue Jul 7, 2022 · 10 comments

Comments

@sQVe
Copy link

sQVe commented Jul 7, 2022

👋🏼,

Before mentioning anything I just want to give you a huge thank you @ggandor. I've been using this plugin and lightspeed on a daily basis for a long time and they are essential to my tool kit.


I noted today that I sometimes lost track on here my cursor was when searching with leap.nvim. After some exploration I found that it was due to poor highlighting when leap.nvim automatically jumps to the closes match, and before inputting a label.

I think the following two screenshots explains it better than any words:

image
image

As you can see in ☝🏼 there's a huge difference in how visible the cursor is. I would like the cursor to have the same highlight.

Just ping me if I need to provide any more information 🙏🏼

@ggandor
Copy link
Owner

ggandor commented Jul 7, 2022

Yes, I'm noticing the same issue with certain colorschemes. No idea about the cause, we simply use the Cursor highlight group. Hopefully this whole virtual cursor hack will soon(er or later) become irrelevant: neovim/neovim#19035.

@ggandor ggandor added the bug Something isn't working label Jul 10, 2022
@ggandor ggandor changed the title Poor highlighting on first automatic jump Problems with cursor highlight Jul 15, 2022
@bmulholland
Copy link

I have a similar problem with neovim-ayu (light mode). I dug in and that theme doesn't set Cursor at all, instead using a few variants. I don't know enough about highlight groups to know if this is a bug in the theme (which should set cursor) or in leap (which should support the different cursor style). Let me know if this is something the theme should support and I'll file an issue with them.

@ggandor
Copy link
Owner

ggandor commented Jul 29, 2022

Oh, that explains it. Of course themes should define Cursor. (Note: Those other groups with "Cursor" in their names aren't related to the cursor highlight, they are for highlighting the current (=cursor) line, column, and the line number on the current line.)

@bmulholland
Copy link

Then it sounds like the bug is in the themes, not leap? (And BTW, the issue is now fixed for neovim-ayu :) )

@ggandor
Copy link
Owner

ggandor commented Jul 29, 2022

Well, yeah, it don't think it's our responsibility to define fallback settings, and to do checks in the first place - Cursor is a built-in highlight group, it should be assumed to have proper attributes. So the only thing I could suggest in these cases is to submit issues/PR-s in the corresponding colorscheme repos.

@ggandor ggandor removed the bug Something isn't working label Jul 29, 2022
@trkoch
Copy link

trkoch commented Aug 6, 2022

I was tricked by this was well. It seems to me the default theme of Neovim has not defined Cursor either.

@ctstacey
Copy link

ctstacey commented Dec 9, 2022

I was tricked by this was well. It seems to me the default theme of Neovim has not defined Cursor either.

Thanks, this got me too - and how many others? haha
Defining the "Cursor" highlight group worked for me.
(could also use other colour schemes that define the "Cursor" highlight group)

nvim-leap--default-colorshceme--add-cursor
Note: :colorscheme <schemename> command only temporarily change the colour scheme.

@kiil
Copy link

kiil commented Feb 25, 2023

Easy fix that worked for me was

vim.api.nvim_set_hl(0, 'Cursor', { reverse = true })

@awerebea
Copy link

awerebea commented May 5, 2024

@kiil

Easy fix that worked for me was

vim.api.nvim_set_hl(0, 'Cursor', { reverse = true })

This workaround doesn't work in the nvim nightly:
cursor_095
cursor_nightly
Any thoughts on how to fix it?

@ggandor
Copy link
Owner

ggandor commented May 5, 2024

Update nightly nvim (and leap), f1f19fc should have fixed the issue, no need for workarounds.

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

7 participants