summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_textprop.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-17 23:21:40 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-17 23:21:40 +0200
commit6e940d9a1d4ff122aad1b0821c784a60b507d45c (patch)
tree318ffe4cdff069b3c5a494154480581750f777c3 /src/testdir/test_textprop.vim
parent8cfe52e6fbf44032cd40d1561e93644786b15ee7 (diff)
patch 9.0.1731: blockwise Visual highlight not working with virtual textv9.0.1731
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>
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r--src/testdir/test_textprop.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index 67547f00a4..d3a061d06a 100644
--- 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:')