mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 19:35:37 +00:00
vim-patch:9.1.0334: No test for highlight behavior with 'ambiwidth' (#28354)
Problem: No test for highlight behavior with 'ambiwidth'.
Solution: Add a screendump test for 'ambiwidth' with 'cursorline'.
(zeertzjq)
closes: vim/vim#14554
a59e031aa0
This commit is contained in:
@@ -372,7 +372,7 @@ func Test_multibyte_chars()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" check that 'ambiwidth' does not change the meaning of \p
|
" check that 'ambiwidth' does not change the meaning of \p
|
||||||
func Test_ambiwidth()
|
func Test_regexp_ambiwidth()
|
||||||
set regexpengine=1 ambiwidth=single
|
set regexpengine=1 ambiwidth=single
|
||||||
call assert_equal(0, match("\u00EC", '\p'))
|
call assert_equal(0, match("\u00EC", '\p'))
|
||||||
set regexpengine=1 ambiwidth=double
|
set regexpengine=1 ambiwidth=double
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ func Test_customlist_completion()
|
|||||||
call assert_equal('"Test3 N', getreg(':'))
|
call assert_equal('"Test3 N', getreg(':'))
|
||||||
|
|
||||||
call garbagecollect(1)
|
call garbagecollect(1)
|
||||||
|
delcommand Test1
|
||||||
|
delcommand Test2
|
||||||
|
delcommand Test3
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Yank one 3 byte character and check the mark columns.
|
" Yank one 3 byte character and check the mark columns.
|
||||||
@@ -297,6 +300,40 @@ func Test_setcellwidths_dump()
|
|||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
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()
|
||||||
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
call setline(1, [repeat("\u2103", 60), repeat("\u2103", 60)])
|
||||||
|
set ambiwidth=single cursorline list display=lastline
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XAmbiwidthHl', 'D')
|
||||||
|
let buf = RunVimInTerminal('-S XAmbiwidthHl', {'rows': 6, 'cols': 50})
|
||||||
|
call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, ":set ambiwidth=double\<CR>")
|
||||||
|
call term_sendkeys(buf, ":echo\<CR>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_2', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, ":set ambiwidth=single\<CR>")
|
||||||
|
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', {})
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
func Test_print_overlong()
|
func Test_print_overlong()
|
||||||
" Text with more composing characters than MB_MAXBYTES.
|
" Text with more composing characters than MB_MAXBYTES.
|
||||||
new
|
new
|
||||||
|
|||||||
Reference in New Issue
Block a user