summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_utf8.vim
diff options
context:
space:
mode:
authormikoto2000 <mikoto2000@gmail.com>2024-04-17 22:06:54 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-17 22:06:54 +0200
commite20fa59903525e15cecd680a2f32ece8a5d1bc0c (patch)
tree3d98c187460597c6d76c28b16faab77723425213 /src/testdir/test_utf8.vim
parentacdfb8a97995e0f81832207e39564ba795281108 (diff)
patch 9.1.0344: Cursor wrong after using setcellwidth() in terminalv9.1.0344
Problem: Cursor wrong after using setcellwidth() in terminal (mikoto2000) Solution: output additional spaces, so the behaviour matches the GUI (mikoto2000) fixes: #14539 closes: #14540 Signed-off-by: mikoto2000 <mikoto2000@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org> Fix CUI `setcellwidths` characters draw behavior to same GUI behavior.
Diffstat (limited to 'src/testdir/test_utf8.vim')
-rw-r--r--src/testdir/test_utf8.vim24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim
index df0abd354c..3fd83cf79f 100644
--- a/src/testdir/test_utf8.vim
+++ b/src/testdir/test_utf8.vim
@@ -300,6 +300,28 @@ func Test_setcellwidths_dump()
call StopVimInTerminal(buf)
endfunc
+" When `setcellwidth` is used on characters that are not targets of `ambiwidth`.
+func Test_setcellwidths_with_non_ambiwidth_character_dump()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ call setline(1, [repeat("\u279c", 60), repeat("\u279c", 60)])
+ set ambiwidth=single
+ END
+ call writefile(lines, 'XCellwidthsWithNonAmbiwidthCharacter', 'D')
+ let buf = RunVimInTerminal('-S XCellwidthsWithNonAmbiwidthCharacter', {'rows': 6, 'cols': 50})
+ call term_sendkeys(buf, ":call setcellwidths([[0x279c, 0x279c, 1]])\<CR>")
+ call term_sendkeys(buf, ":echo\<CR>")
+ call VerifyScreenDump(buf, 'Test_setcellwidths_with_non_ambiwidth_character_dump_1', {})
+
+ call term_sendkeys(buf, ":call setcellwidths([[0x279c, 0x279c, 2]])\<CR>")
+ call term_sendkeys(buf, ":echo\<CR>")
+ call VerifyScreenDump(buf, 'Test_setcellwidths_with_non_ambiwidth_character_dump_2', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
+
" For some reason this test causes Test_customlist_completion() to fail on CI,
" so run it as the last test.
func Test_zz_ambiwidth_hl_dump()
@@ -321,7 +343,6 @@ func Test_zz_ambiwidth_hl_dump()
call term_sendkeys(buf, ":echo\<CR>")
call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {})
- if 0 " Enable after #14539 is fixed
call term_sendkeys(buf, ":call setcellwidths([[0x2103, 0x2103, 2]])\<CR>")
call term_sendkeys(buf, ":echo\<CR>")
call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_2', {})
@@ -329,7 +350,6 @@ func Test_zz_ambiwidth_hl_dump()
call term_sendkeys(buf, ":call setcellwidths([[0x2103, 0x2103, 1]])\<CR>")
call term_sendkeys(buf, ":echo\<CR>")
call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {})
- endif
call StopVimInTerminal(buf)
endfunc