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 the new version #115

Closed
iaurman opened this issue Aug 20, 2022 · 7 comments
Closed

Problems with the new version #115

iaurman opened this issue Aug 20, 2022 · 7 comments

Comments

@iaurman
Copy link

iaurman commented Aug 20, 2022

Yesterday it was the block highlight. Today after update, it's instead the underline highlight. Have tried hi link illuminatedWord Visual, doesn't work.

Also, in the newer version, sometimes all the same words highlight, which is good. But sometimes, only the word under cursor is highlighted even if the same word is right next to it. Sometimes it just doesn't highlight at all. It's so inconsistent even within the same file. Come on.
image
image
image

@ugoschieli
Copy link

Same problem, now it underlines words instead of highlight them

@Allaman
Copy link

Allaman commented Aug 20, 2022

I think this is as intended see https://github.com/RRethy/vim-illuminate#highlight-groups ?

You could overwrite these highlight groups to your liking

@iaurman
Copy link
Author

iaurman commented Aug 20, 2022

I think this is as intended see https://github.com/RRethy/vim-illuminate#highlight-groups ?

You could overwrite these highlight groups to your liking

I think i tried that with stanout and strikethrough. But it doesn't seem to have any effect on it. What should I config?

@krish-r
Copy link

krish-r commented Aug 20, 2022

I believe it should be -

vimscript

hi link IlluminatedWordText Visual
hi link IlluminatedWordRead Visual
hi link IlluminatedWordWrite Visual

lua

vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "Visual" })
vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "Visual" })
vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "Visual" })

@Allaman
Copy link

Allaman commented Aug 20, 2022

@krish-r I can confirm the lua part - was just writing something similar 😄
image

@RRethy
Copy link
Owner

RRethy commented Aug 20, 2022

I updated the migration guide to make it clear the highlight groups changed. FWIW they changed because now highlights can have a type which wasn't the case before. What @krish-r posted is correct.

Also, in the newer version, sometimes all the same words highlight, which is good. But sometimes, only the word under cursor is highlighted even if the same word is right next to it. Sometimes it just doesn't highlight at all. It's so inconsistent even within the same file. Come on.

@iaurman You'll have to be a bit more specific here, are you using tree-sitter or LSP? If so, then the highlighting is dependant on what they provide. In the screenshots you showed you hovered on return and int, for return it's out of scope of the other return so having them both highlight wouldn't make sense, and for int it's a builtin type not an identifier so most LSP servers and tree-sitter won't highlight it. It sounds like you want the naive highlighting from only regex matching which you have achieve with this:

require('illuminate').configure({
    providers = {
        'regex',
    },
}

If you want something different, you'll need to provide more information than a couple of screenshots which aren't very useful to anyone, it's not even clear what language you are using (it could be C/C++/Java).

I'll leave this issue open for a day in case of follow-ups.

@iaurman
Copy link
Author

iaurman commented Aug 20, 2022

I updated the migration guide to make it clear the highlight groups changed. FWIW they changed because now highlights can have a type which wasn't the case before. What @krish-r posted is correct.

Also, in the newer version, sometimes all the same words highlight, which is good. But sometimes, only the word under cursor is highlighted even if the same word is right next to it. Sometimes it just doesn't highlight at all. It's so inconsistent even within the same file. Come on.

@iaurman You'll have to be a bit more specific here, are you using tree-sitter or LSP? If so, then the highlighting is dependant on what they provide. In the screenshots you showed you hovered on return and int, for return it's out of scope of the other return so having them both highlight wouldn't make sense, and for int it's a builtin type not an identifier so most LSP servers and tree-sitter won't highlight it. It sounds like you want the naive highlighting from only regex matching which you have achieve with this:

require('illuminate').configure({
    providers = {
        'regex',
    },
}

If you want something different, you'll need to provide more information than a couple of screenshots which aren't very useful to anyone, it's not even clear what language you are using (it could be C/C++/Java).

I'll leave this issue open for a day in case of follow-ups.

Sorry for the delay. Yes, krish-r's answer and the regex highlighting is my solution. My LSP and tree-sitter might not be working properly before thus causing me to think it's a problem here. Thanks for the solution.

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

5 participants