Mercurial > vim
comparison src/testdir/test_textprop.vim @ 31990:27ab829631df v9.0.1327
patch 9.0.1327: cursor in wrong position below line with virtual text below
Commit: https://github.com/vim/vim/commit/ea62cee85e9e77ec86edd9843926dadb69978753
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 19 18:36:41 2023 +0000
patch 9.0.1327: cursor in wrong position below line with virtual text below
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 19 Feb 2023 19:45:03 +0100 |
parents | a7801ecf7df9 |
children | 533e36e02a68 |
comparison
equal
deleted
inserted
replaced
31989:bfb00817db23 | 31990:27ab829631df |
---|---|
2815 call VerifyScreenDump(buf, 'Test_prop_above_below_empty_5', {}) | 2815 call VerifyScreenDump(buf, 'Test_prop_above_below_empty_5', {}) |
2816 | 2816 |
2817 call StopVimInTerminal(buf) | 2817 call StopVimInTerminal(buf) |
2818 endfunc | 2818 endfunc |
2819 | 2819 |
2820 func Test_prop_with_multibyte_below() | |
2821 CheckRunVimInTerminal | |
2822 | |
2823 let lines =<< trim END | |
2824 setlocal number | |
2825 call setline(1, ['©', '©', '©']) | |
2826 | |
2827 let vt = 'test' | |
2828 call prop_type_add(vt, {'highlight': 'ToDo'}) | |
2829 for ln in range(1, line('$')) | |
2830 call prop_add(ln, 0, {'type': vt, 'text': '+++', 'text_align': 'below'}) | |
2831 endfor | |
2832 normal G | |
2833 END | |
2834 call writefile(lines, 'XscriptPropMultibyteBelow', 'D') | |
2835 let buf = RunVimInTerminal('-S XscriptPropMultibyteBelow', #{rows: 10, cols: 60}) | |
2836 call VerifyScreenDump(buf, 'Test_prop_multibyte_below_1', {}) | |
2837 | |
2838 call StopVimInTerminal(buf) | |
2839 endfunc | |
2840 | |
2820 func Test_prop_with_text_above_empty() | 2841 func Test_prop_with_text_above_empty() |
2821 CheckRunVimInTerminal | 2842 CheckRunVimInTerminal |
2822 | 2843 |
2823 " check the cursor is in the correct line | 2844 " check the cursor is in the correct line |
2824 let lines =<< trim END | 2845 let lines =<< trim END |