vim-highlighter icon indicating copy to clipboard operation
vim-highlighter copied to clipboard

Error while creating a highlighting while selecting a single line with visual line mode

Open david-pikas opened this issue 2 years ago • 1 comments

See title.

Selecting a single line in visual line mode and then pressing f<CR> causes the following error:

Error detected while processing function highlighter#Command[22]..<SNR>168_SetHighlight[28]..<SNR>168_GetVisualLine:
line    9:
E951: \% value too large

After the error is dismissed the line is successfully highlighted

Digging around, the error seems to occur at line 264 of autoload/highlighter.vim. One guess is that it is caused by an of-by-one error and indeed changing l:right to l:right-1 does cause the error to go away. I'm not sure what the intended purpose of the function is as the highlighting seems to work even when the error occurs so I'm not sure that this fix preserves the intended functionality of the code.

david-pikas avatar Oct 10 '22 09:10 david-pikas

Thank you for reporting this error 👍 Now there is an update. Would you please try it?

azabiong avatar Oct 10 '22 13:10 azabiong

The error seems to be fixed now!

david-pikas avatar Nov 02 '22 11:11 david-pikas

Great, Thanks!

azabiong avatar Nov 05 '22 04:11 azabiong