diff options
author | Bram Moolenaar <Bram@vim.org> | 2023-02-19 18:36:41 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-19 18:36:41 +0000 |
commit | ea62cee85e9e77ec86edd9843926dadb69978753 (patch) | |
tree | 2e7fdc9e075d6c1df881153bfdc3aa393361db01 /src/testdir | |
parent | a572b936ce7bbaf630b22a32c039738a783cdf41 (diff) |
patch 9.0.1327: cursor in wrong position below line with virtual text belowv9.0.1327
Problem: Cursor in wrong position below line with virtual text below ending
in multi-byte character.
Solution: When checking for last character take care of multi-byte
character.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/dumps/Test_prop_multibyte_below_1.dump | 10 | ||||
-rw-r--r-- | src/testdir/test_textprop.vim | 21 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_prop_multibyte_below_1.dump b/src/testdir/dumps/Test_prop_multibyte_below_1.dump new file mode 100644 index 0000000000..838611b999 --- /dev/null +++ b/src/testdir/dumps/Test_prop_multibyte_below_1.dump @@ -0,0 +1,10 @@ +| +0#af5f00255#ffffff0@1|1| |©+0#0000000&| @54 +| +0#af5f00255&@3|++0#0000001#ffff4012@2| +0#0000000#ffffff0@52 +| +0#af5f00255&@1|2| |©+0#0000000&| @54 +| +0#af5f00255&@3|++0#0000001#ffff4012@2| +0#0000000#ffffff0@52 +| +0#af5f00255&@1|3| >©+0#0000000&| @54 +| +0#af5f00255&@3|++0#0000001#ffff4012@2| +0#0000000#ffffff0@52 +|~+0#4040ff13&| @58 +|~| @58 +|~| @58 +| +0#0000000&@41|3|,|1| @10|A|l@1| diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index 3bd08fe4d7..cd141eb6a0 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2817,6 +2817,27 @@ func Test_prop_with_text_above_below_empty() call StopVimInTerminal(buf) endfunc +func Test_prop_with_multibyte_below() + CheckRunVimInTerminal + + let lines =<< trim END + setlocal number + call setline(1, ['©', '©', '©']) + + let vt = 'test' + call prop_type_add(vt, {'highlight': 'ToDo'}) + for ln in range(1, line('$')) + call prop_add(ln, 0, {'type': vt, 'text': '+++', 'text_align': 'below'}) + endfor + normal G + END + call writefile(lines, 'XscriptPropMultibyteBelow', 'D') + let buf = RunVimInTerminal('-S XscriptPropMultibyteBelow', #{rows: 10, cols: 60}) + call VerifyScreenDump(buf, 'Test_prop_multibyte_below_1', {}) + + call StopVimInTerminal(buf) +endfunc + func Test_prop_with_text_above_empty() CheckRunVimInTerminal |