Open louis-vinchon opened 1 year ago
Visually select anything. Run :HSHighlight 1 (the command line should show :'<,'>HSHighlight 1).
That's the thing. After you type :
, you get '<,'>
. You need to press Ctrl+u to remove it and type the rest of the command.
In bindings, use :<C-u>HSHighlight
and same for removal
Immediate issue
The
HSRmHighlight
documentation states:Removing all highlights works fine.
However visually selecting a range and runing the function throws the following error:
I tried both visual line and line selections, and both throw the same error.
I just realized that it was an issue with the Highlight command as well: the command doesn't work on what is currently visually selected; but it works when nothing is selected, it will highlight what was last selected.
Reproduction steps:
:HSHighlight 1
(the command line should show:'<,'>HSHighlight 1
).normal
mode at this point, run:HSHighlight 1
again.Other unexpected behavior
:HSRmHighlight
will apparently remove more than what was last selected:Removing line-wise highlights
Reproduction steps:
n
with color X (<S-v>
mapping).n + 1
with color Y:HSRmHighlight
without anything visually selected.n
(in color X). it should only have erased the last thing we selected (the last highlight, in color Y).Removing "regular" highlights
Reproduction steps:
:HSRmHighlight
without anything visually selected.The relative position of the highlighted ranges does not matter.
Bonus
It appears that the
:HSRmHighlight
command also erases highlights from other plugins such asindent-blankline
, fortunately that's a temporary issue.