int old_topfill;
int init_topfill = curwin->w_topfill;
# endif
- linenr_T old_botline;
+ linenr_T old_botline, old_empty_rows;
linenr_T init_botline = curwin->w_botline;
+ linenr_T init_empty_rows = curwin->w_empty_rows;
int did_incsearch = FALSE;
int incsearch_postponed = FALSE;
#endif
old_topfill = curwin->w_topfill;
# endif
old_botline = curwin->w_botline;
+ old_empty_rows = curwin->w_empty_rows;
#endif
/*
old_topfill = init_topfill;
# endif
old_botline = init_botline;
+ old_empty_rows = init_empty_rows;
}
#endif
redrawcmd();
old_topfill = curwin->w_topfill;
# endif
old_botline = curwin->w_botline;
+ old_empty_rows = curwin->w_empty_rows;
update_screen(NOT_VALID);
redrawcmdline();
}
curwin->w_topfill = old_topfill;
# endif
curwin->w_botline = old_botline;
+ curwin->w_empty_rows = old_empty_rows;
changed_cline_bef_curs();
update_topline();
curwin->w_topfill = old_topfill;
# endif
curwin->w_botline = old_botline;
+ curwin->w_empty_rows = old_empty_rows;
highlight_match = FALSE;
validate_cursor(); /* needed for TAB */
redraw_all_later(SOME_VALID);
" Test for the search command
source shared.vim
+source screendump.vim
func Test_search_cmdline()
if !exists('+incsearch')
bwipe!
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