nvim-treesitter / nvim-treesitter-refactor

Refactor module for nvim-treesitter
Apache License 2.0
407 stars 25 forks source link

Highlight current scope - full buffer width? #12

Open weilbith opened 3 years ago

weilbith commented 3 years ago

Is your feature request related to a problem? Please describe. I like the idea of having the current scope highlighted. But I must admit that I get "annoyed" that only the texts background changes. So depending on the different lines length and empty lines etc this just looks ugly in my very personal opinion.

Describe the solution you'd like The highlight applies to the full line for the whole length of the buffer like the cursorline does. I'm afraid that is not simply possible from the current highlight API...

Describe alternatives you've considered Well, just disable the current scope highlight...

Additional context :shrug:

theHamsta commented 3 years ago

My original idea was to dim non-current-scope text a bit, at least this should be possible now.

pwntester commented 3 years ago

Came here from pwntester/octo.nvim#105

There is a workaround to apply a highlight to the whole window-width line (including EOL space). You can define a sign and apply a linehl group such as in:

sign define octo_comment text=❯ texthl=OctoNvimCommentLine linehl=OctoNvimCommentLine 

not sure if this helps here though 🤷🏻

weilbith commented 3 years ago

Do sign highlights sum up? Let's say I have a LSP diagnostic error in my current scope. This LSP sign has no linhehl but only a text. Would I then still have the background color of the lower prio sign from current scope? Sorry if that reads confusing. I should just try it out myself...

pwntester commented 3 years ago

Im not sure, I guess the best way to figure it out is try adding two signs on the same line with different hl options