patch 9.0.0132: multi-byte characters in virtual text not handled correctly
Problem: Multi-byte characters in virtual text not handled correctly.
Solution: Count screen cells instead of bytes.
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 832343d..46ee37e 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2199,8 +2199,11 @@
call prop_add(1, 18, #{type: 'someprop', text: 'SOME '})
call prop_add(1, 38, #{type: 'otherprop', text: "OTHER\t"})
call prop_add(1, 69, #{type: 'moreprop', text: 'MORE '})
- redraw
normal $
+
+ call setline(2, 'prepost')
+ call prop_type_add('multibyte', #{highlight: 'Visual'})
+ call prop_add(2, 4, #{type: 'multibyte', text: 'söme和平téxt'})
END
call writefile(lines, 'XscriptPropsWithText')
let buf = RunVimInTerminal('-S XscriptPropsWithText', #{rows: 6, cols: 60})
@@ -2228,6 +2231,9 @@
call setline(2, 'Last line.')
call prop_add(2, 0, #{type: 'afterprop', text: ' After Last ', text_align: 'after'})
normal G$
+
+ call setline(3, 'right here')
+ call prop_add(3, 0, #{type: 'rightprop', text: 'söme和平téxt', text_align: 'right'})
END
call writefile(lines, 'XscriptPropsWithTextAfter')
let buf = RunVimInTerminal('-S XscriptPropsWithTextAfter', #{rows: 6, cols: 60})