azabiong / vim-highlighter

Highlight words and expressions
MIT License
226 stars 9 forks source link

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

Closed david-pikas closed 1 year ago

david-pikas commented 1 year ago

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.

azabiong commented 1 year ago

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

david-pikas commented 1 year ago

The error seems to be fixed now!

azabiong commented 1 year ago

Great, Thanks!