aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_search.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-12-22 11:24:48 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-12-22 11:50:16 -0500
commitbc8da6cdbe4e300344e45dbc2eb5b22a7afc9e89 (patch)
tree5d5b43124e1e9ae60ab1d241238838682065d44d /src/nvim/testdir/test_search.vim
parent9e9dcd4bd79cc5ea0fd240bcb242ceea07deabe2 (diff)
downloadrneovim-bc8da6cdbe4e300344e45dbc2eb5b22a7afc9e89.tar.gz
rneovim-bc8da6cdbe4e300344e45dbc2eb5b22a7afc9e89.tar.bz2
rneovim-bc8da6cdbe4e300344e45dbc2eb5b22a7afc9e89.zip
vim-patch:8.0.1767: with 'incsearch' text may jump up and down
Problem: With 'incsearch' text may jump up and down. () Solution: Besides w_botline also save and restore w_empty_rows. (closes # 2530) https://github.com/vim/vim/commit/9d34d90210ba52ebaf45973282e5921f5af364c7
Diffstat (limited to 'src/nvim/testdir/test_search.vim')
-rw-r--r--src/nvim/testdir/test_search.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 68eb311e3c..5d99027ca5 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
@@ -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