diff options
Diffstat (limited to 'src/testdir')
3 files changed, 34 insertions, 2 deletions
diff --git a/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_1.dump b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_1.dump new file mode 100644 index 0000000000..73f4418126 --- /dev/null +++ b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_1.dump @@ -0,0 +1,6 @@ +>➜+0&#ffffff0@49 +@10| @39 +|➜@49 +@10| @39 +|~+0#4040ff13&| @48 +| +0#0000000&@31|1|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_2.dump b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_2.dump new file mode 100644 index 0000000000..2b575f6b39 --- /dev/null +++ b/src/testdir/dumps/Test_setcellwidths_with_non_ambiwidth_character_dump_2.dump @@ -0,0 +1,6 @@ +>➜+0&#ffffff0| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| +|➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| +|➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| @30 +|➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| |➜| +|@+0#4040ff13&@2| @46 +| +0#0000000&@31|1|,|1| @10|T|o|p| 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 |