diff options
Diffstat (limited to 'src/nvim/testdir/test_search.vim')
-rw-r--r-- | src/nvim/testdir/test_search.vim | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index 5d4c2a015f..8036dea29f 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -1,6 +1,7 @@ " Test for the search command source shared.vim +source screendump.vim func Test_search_cmdline() " See test/functional/legacy/search_spec.lua @@ -57,7 +58,7 @@ func Test_search_cmdline() call feedkeys("/the".repeat("\<C-G>", 6)."\<cr>", 'tx') call assert_equal(' 8 them', getline('.')) :1 - " eigth match + " eighth match call feedkeys("/the".repeat("\<C-G>", 7)."\<cr>", 'tx') call assert_equal(' 9 these', getline('.')) :1 @@ -99,7 +100,7 @@ func Test_search_cmdline() call feedkeys("/the".repeat("\<C-G>", 6)."\<cr>", 'tx') call assert_equal(' 8 them', getline('.')) :1 - " eigth match + " eighth match call feedkeys("/the".repeat("\<C-G>", 7)."\<cr>", 'tx') call assert_equal(' 9 these', getline('.')) :1 @@ -549,6 +550,36 @@ func Test_incsearch_with_change() call delete('Xis_change_script') endfunc +func Test_incsearch_scrolling() + if !CanRunVimInTerminal() + return + endif + call assert_equal(0, &scrolloff) + call writefile([ + \ 'let dots = repeat(".", 120)', + \ 'set incsearch cmdheight=2 scrolloff=0', + \ 'call setline(1, [dots, dots, dots, "", "target", dots, dots])', + \ 'normal gg', + \ 'redraw', + \ ], 'Xscript') + let buf = RunVimInTerminal('-S Xscript', {'rows': 9, 'cols': 70}) + " Need to send one key at a time to force a redraw + call term_sendkeys(buf, '/') + sleep 100m + call term_sendkeys(buf, 't') + sleep 100m + call term_sendkeys(buf, 'a') + sleep 100m + call term_sendkeys(buf, 'r') + sleep 100m + call term_sendkeys(buf, 'g') + call VerifyScreenDump(buf, 'Test_incsearch_scrolling_01', {}) + + call term_sendkeys(buf, "\<Esc>") + call StopVimInTerminal(buf) + call delete('Xscript') +endfunc + func Test_search_undefined_behaviour() if !has("terminal") return @@ -667,3 +698,9 @@ func Test_search_display_pattern() set norl endif endfunc + +func Test_search_special() + " this was causing illegal memory access and an endless loop + set t_PE= + exe "norm /\x80PS" +endfunc |