Closed dubrayn closed 1 year ago
Hi, thanks for using this plugin and suggesting very useful features. I think it would be great if these things are gradually supported.
As for the first function, I think we can implement it like coloring a specific location with a marker pen. Regarding multi-line visual mode highlighting, I'm looking for a nice way to easily turn it on and off with a rectangular shape.
I will try to support the first feature first and let you know when there is an update. Thanks.
Hi, There are some updates on this. Position-based highlighting using visual-block mode selection is now supported.
Would you like to try it? It's quite a different type, but I think it can be useful sometimes.
As for multi-line highlighting, I'm not quite sure whether it should be positional or pattern-based highlighting. I guess I need to find out more.
Hi, thanks for the new version.
There seems to be a bug with it when I use the command :Hi +x%<cr>
in normal mode, after having made a visual selection :
Error detected while processing function highlighter#Command[25]..<SNR>81_SetHighlight[25]..<SNR>81_GetVisualBlock:
line 13:
E951: \% value too large
This error is not present on commit c2412c1
of vim-highlighter
.
Let me know if I can help with the debug.
Thank you for checking this!
I found that this happens when the selection
mode is inclusive. Now, there is an update. I think it should work now.
It works with a visual block now but not with a visual line (S+v
).
Yes, right. Would you please try the fixed version 1.57.3
?
I do not see any version more recent than 34837cb
and this version has the error.
Thank you for checking it. That's the 1.57.3
.
On my side, there is no more E951 error in both inclusive and exclusive selection
mode.
Are you still getting the error message? Or only one line is selected?
I have the message if :
:Hi +x%<cr>
.If only one line was selected in 'visual line' mode, the highlighting is fine (but there is the annoying error message). If more than one line was selected, I see the message and no highlighting is done (as expected from your explanation "Regarding multi-line visual mode highlighting, I'm looking for a nice way to easily turn it on and off with a rectangular shape.").
Thanks for your update. I am trying to reproduce this issue, but it's not easy...
Would please try :Hi
command to check the version, and may I ask what version of vim are you using?
:Hi
returns Highlighter version 1.57.3
, and I am using Neovim v0.10.0-dev-380+gc855eee91.
Thank you! I will try it.
I found it!
I'm sure 1.57.4
will fix the problem this time.
The point was whether the current mode was case sensitive or not when the set ic
option is enabled.
The new version now uses the option independent '==#' operator instead of '=='.
I confirm that the error message is gone. Thanks a lot for the fix !
Great! Thanks for confirming that it works.
Hi, there is a nice update to this feature!
The plugin now uses new APIs from Neovim and Vim that supports buffer-associated highlights. The highlight positions are now managed smoothly when editing text. Multiline highlighting is now also supported.
New version → Positional Highlight
HiSetSL
key is now added to the default key map.HiColor80
.It looks like all requested features are now implemented. I hope you like this update! Thanks.
It works nicely, thanks.
Thank you for your confirmation!
Then it seems that all three features you mentioned are implemented. Can I close the issue?
And if you don't mind, I'd like to add your name to the credits section of the help file for this great feature.
:h Hi-Credit
So, may I ask your name?
Hello, you can close the issue, thanks again. You can use my name for the credits if you want (not sure that I helped in any constructive way) : N. Dubray
Nice! I think this feature is very special and enabled highlighter's original function properly. Thank you for your great feature suggestion and help in resolving the problem quickly. I added your name to the credits section.
:h Hi-Credits
Thank you!
Hello, this plugin is very nice. I use it to show some parts of code to students / coworkers. One thing is missing IMHO: the possibility to highlight EXACTLY the current visual selection.
For example, for the given buffer content:
If I select (in visual mode) the first
test
occurence of the first line, the command:<C-U>Hi +x<cr>
will highlight the three occurences oftest
of the first line. I would like to highlight only the first occurence of the first line.If I select (in visual mode) both lines, no single command will allow me to highlight both lines.
If I select (in visual mode) some part of both lines, no command will allow me to highlight this exact selection.
Maybe am I missing some magic trick ?
Thanks anyway for the nice plugin.