-
Notifications
You must be signed in to change notification settings - Fork 25
Chinese characters will cause incorrect highlighting #51
Comments
Ok, so I did some research, read this neovim/neovim#6161, and then I just tried this: --- i/autoload/lsp_cxx_hl/textprop_nvim.vim
+++ w/autoload/lsp_cxx_hl/textprop_nvim.vim
@@ -19,8 +19,12 @@ function! s:buf_add_hl(buf, ns_id, hl_group,
" single line symbol
if a:s_line == a:e_line
if a:e_char - a:s_char > 0
+ let line = getbufline(a:buf, a:s_line + 1)[0]
call nvim_buf_add_highlight(a:buf, a:ns_id, a:hl_group,
- \ a:s_line, a:s_char, a:e_char)
+ \ a:s_line,
+ \ byteidx(line, a:s_char),
+ \ byteidx(line, a:e_char))
return
else
return And it works. Works just fine. Please kindly @jackguo380 assist me, where in the code base should I put this transformation, so that also |
Hey @Kamilcuk That's great that you found a potential solution. Could you open a PR with the code so I can review it? Just some suggestions:
Thanks for looking into this. |
Describe the bug
If there is a Chinese character string, the highlighting of this line of code will be incorrect.
See line 7 of the screenshot for details
To Reproduce
Expected behavior
Line 6 of the screenshot is what I expected.
Screenshots
Configuration (Fill this out):
Log File:
The text was updated successfully, but these errors were encountered: