Mercurial > vim
diff src/testdir/test_textprop.vim @ 32838:eaf22d1df3c1 v9.0.1731
patch 9.0.1731: blockwise Visual highlight not working with virtual text
Commit: https://github.com/vim/vim/commit/6e940d9a1d4ff122aad1b0821c784a60b507d45c
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Aug 17 23:21:40 2023 +0200
patch 9.0.1731: blockwise Visual highlight not working with virtual text
Problem: blockwise Visual highlight not working with virtual text
Solution: Reset the correct variable at the end of virtual selection and
Check for double-width char inside virtual text.
closes: #12606
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 17 Aug 2023 23:30:04 +0200 |
parents | f1fdbcd46f3a |
children | 7a1a9ce831c3 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2602,6 +2602,33 @@ func Test_prop_inserts_text_highlight() call StopVimInTerminal(buf) endfunc +func Test_prop_inserts_text_visual_block() + CheckRunVimInTerminal + + let lines =<< trim END + call setline(1, repeat(['123456789'], 3)) + call prop_type_add('theprop', #{highlight: 'Special'}) + call prop_add(2, 2, {'type': 'theprop', 'text': '-口-'}) + END + call writefile(lines, 'XscriptPropsVisualBlock', 'D') + let buf = RunVimInTerminal('-S XscriptPropsVisualBlock', #{rows: 6, cols: 60}) + call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_1', {}) + call term_sendkeys(buf, "\<C-V>2jl") + call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_2', {}) + call term_sendkeys(buf, "l") + call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_3', {}) + call term_sendkeys(buf, "4l") + call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_4', {}) + call term_sendkeys(buf, "Ol") + call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_5', {}) + call term_sendkeys(buf, "l") + call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_6', {}) + call term_sendkeys(buf, "l") + call VerifyScreenDump(buf, 'Test_prop_inserts_text_visual_block_7', {}) + + call StopVimInTerminal(buf) +endfunc + func Test_prop_add_with_text_fails() call prop_type_add('failing', #{highlight: 'ErrorMsg'}) call assert_fails("call prop_add(1, 0, #{type: 'failing', text: 'X', end_lnum: 1})", 'E1305:')