vim-patch:8.2.0936: some terminals misinterpret the code for getting cursor style

Problem:    Some terminals misinterpret the code for getting cursor style.
Solution:   Send a sequence to the terminal and check the result. (IWAMOTO
            Kouichi, closes vim/vim#2126)  Merged with current code.
a45551a535

Cherry-pick Test_cwindow_highlight() from patch v8.1.2040
because it is skipped.
This commit is contained in:
Jan Edmund Lazo 2021-06-13 12:26:34 -04:00
parent 8b81218300
commit ac18e26f57
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 24 additions and 1 deletions

View File

@ -2692,6 +2692,28 @@ func Test_cwindow_jump()
set efm&vim
endfunc
func Test_cwindow_highlight()
CheckScreendump
let lines =<< trim END
call setline(1, ['some', 'text', 'with', 'matches'])
write XCwindow
vimgrep e XCwindow
redraw
cwindow 4
END
call writefile(lines, 'XtestCwindow')
let buf = RunVimInTerminal('-S XtestCwindow', #{rows: 12})
call VerifyScreenDump(buf, 'Test_quickfix_cwindow_1', {})
call term_sendkeys(buf, ":cnext\<CR>")
call VerifyScreenDump(buf, 'Test_quickfix_cwindow_2', {})
" clean up
call StopVimInTerminal(buf)
call delete('XtestCwindow')
call delete('XCwindow')
endfunc
func XvimgrepTests(cchar)
call s:setup_commands(a:cchar)

View File

@ -1,5 +1,6 @@
" Tests for startup using utf-8.
source check.vim
source shared.vim
source screendump.vim
@ -73,7 +74,7 @@ func Test_detect_ambiwidth()
\ 'call test_option_not_set("ambiwidth")',
\ 'redraw',
\ ], 'Xscript')
let buf = RunVimInTerminal('-S Xscript', {})
let buf = RunVimInTerminal('-S Xscript', #{keep_t_u7: 1})
call term_wait(buf)
call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>")
call WaitForAssert({-> assert_match('single', term_getline(buf, 1))})