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

Convert byte offset to char, to fix wrong highlight in non ascii text

Open artur-shaik opened this issue 3 years ago • 2 comments

This PR contains code for fixing wrong highlight due to that vim works with bytes not chars. Should fix #61.

Must say that byteidx method in vim sometimes return not exact result, so I used some hacks to shift highlight in right position.

I did't test it with multyline highlight, because couldn't emulate such grammatic error.

This feature disabled by default, to enable it you need to set g:grammarous#convert_char_to_byte to 1.

artur-shaik avatar Nov 30 '20 06:11 artur-shaik

Ok, I finally could make deep dive in this feature. As a result I could remove this hacky condition.

artur-shaik avatar Mar 03 '21 10:03 artur-shaik

Also, added --line-by-line argument to LanguageTool. This fix LT response, when fromx position is in wrong place.

artur-shaik avatar Mar 29 '21 12:03 artur-shaik