From ac18e26f574e7633184b1785852107c3ee9cf9a1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 13 Jun 2021 12:26:34 -0400 Subject: [PATCH] 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. https://github.com/vim/vim/commit/a45551a53557dba98973fdb3ff737dea2fffcda3 Cherry-pick Test_cwindow_highlight() from patch v8.1.2040 because it is skipped. --- src/nvim/testdir/test_quickfix.vim | 22 ++++++++++++++++++++++ src/nvim/testdir/test_startup_utf8.vim | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index bf15f7f52b..14240f0d5f 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -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\") + 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) diff --git a/src/nvim/testdir/test_startup_utf8.vim b/src/nvim/testdir/test_startup_utf8.vim index 1b3d2184a0..bb4304396e 100644 --- a/src/nvim/testdir/test_startup_utf8.vim +++ b/src/nvim/testdir/test_startup_utf8.vim @@ -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\=&ambiwidth\\") call WaitForAssert({-> assert_match('single', term_getline(buf, 1))})