Patch 8.0.1767
Problem: With 'incsearch' text may jump up and down. ()
Solution: Besides w_botline also save and restore w_empty_rows.
(closes # 2530)
Files: src/ex_getln.c, src/testdir/test_search.vim,
src/testdir/dumps/Test_incsearch_scrolling_01.dump
*** ../vim-8.0.1766/src/ex_getln.c 2018-04-07 19:09:05.791413434 +0200
--- src/ex_getln.c 2018-04-27 22:12:27.729026017 +0200
***************
*** 237,244 ****
int old_topfill;
int init_topfill = curwin->w_topfill;
# endif
! linenr_T old_botline;
linenr_T init_botline = curwin->w_botline;
int did_incsearch = FALSE;
int incsearch_postponed = FALSE;
#endif
--- 237,245 ----
int old_topfill;
int init_topfill = curwin->w_topfill;
# endif
! 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
***************
*** 291,296 ****
--- 292,298 ----
old_topfill = curwin->w_topfill;
# endif
old_botline = curwin->w_botline;
+ old_empty_rows = curwin->w_empty_rows;
#endif
/*
***************
*** 1075,1080 ****
--- 1077,1083 ----
old_topfill = init_topfill;
# endif
old_botline = init_botline;
+ old_empty_rows = init_empty_rows;
}
#endif
redrawcmd();
***************
*** 1804,1809 ****
--- 1807,1813 ----
old_topfill = curwin->w_topfill;
# endif
old_botline = curwin->w_botline;
+ old_empty_rows = curwin->w_empty_rows;
update_screen(NOT_VALID);
redrawcmdline();
}
***************
*** 2020,2025 ****
--- 2024,2030 ----
curwin->w_topfill = old_topfill;
# endif
curwin->w_botline = old_botline;
+ curwin->w_empty_rows = old_empty_rows;
changed_cline_bef_curs();
update_topline();
***************
*** 2114,2119 ****
--- 2119,2125 ----
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);
*** ../vim-8.0.1766/src/testdir/test_search.vim 2018-01-30 22:31:13.755952680
+0100
--- src/testdir/test_search.vim 2018-04-27 22:11:08.025519447 +0200
***************
*** 1,6 ****
--- 1,7 ----
" Test for the search command
source shared.vim
+ source screendump.vim
func Test_search_cmdline()
if !exists('+incsearch')
***************
*** 690,695 ****
--- 691,726 ----
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
*** ../vim-8.0.1766/src/testdir/dumps/Test_incsearch_scrolling_01.dump
2018-04-27 22:16:29.727529269 +0200
--- src/testdir/dumps/Test_incsearch_scrolling_01.dump 2018-04-27
22:09:22.318174330 +0200
***************
*** 0 ****
--- 1,9 ----
+ |.+0&#ffffff0@69
+ @50| @19
+ |.@69
+ @50| @19
+ @70
+ |t+1&&|a|r|g|e+0&&|t| @63
+ |@+0#4040ff13&@2| @66
+ |/+0#0000000&|t|a|r|g> @64
+ @70
*** ../vim-8.0.1766/src/version.c 2018-04-26 22:30:29.226565612 +0200
--- src/version.c 2018-04-27 22:12:46.312911006 +0200
***************
*** 763,764 ****
--- 763,766 ----
{ /* Add new patch number below this line */
+ /**/
+ 1767,
/**/
--
Facepalm reply #3: "I had a great time in Manhattan" "I thought you were
going to New York?"
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.