Mercurial > vim
comparison src/testdir/test_search.vim @ 13790:dd6a63e3e7c4 v8.0.1767
patch 8.0.1767: with 'incsearch' text may jump up and down
commit https://github.com/vim/vim/commit/9d34d90210ba52ebaf45973282e5921f5af364c7
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 27 22:18:12 2018 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 27 Apr 2018 22:30:06 +0200 |
parents | fe0cec169589 |
children | 16a062cf08c2 |
comparison
equal
deleted
inserted
replaced
13789:2df62da42cac | 13790:dd6a63e3e7c4 |
---|---|
1 " Test for the search command | 1 " Test for the search command |
2 | 2 |
3 source shared.vim | 3 source shared.vim |
4 source screendump.vim | |
4 | 5 |
5 func Test_search_cmdline() | 6 func Test_search_cmdline() |
6 if !exists('+incsearch') | 7 if !exists('+incsearch') |
7 return | 8 return |
8 endif | 9 endif |
688 | 689 |
689 call delete('Xsearch.txt') | 690 call delete('Xsearch.txt') |
690 bwipe! | 691 bwipe! |
691 endfunc | 692 endfunc |
692 | 693 |
694 func Test_incsearch_scrolling() | |
695 if !CanRunVimInTerminal() | |
696 return | |
697 endif | |
698 call assert_equal(0, &scrolloff) | |
699 call writefile([ | |
700 \ 'let dots = repeat(".", 120)', | |
701 \ 'set incsearch cmdheight=2 scrolloff=0', | |
702 \ 'call setline(1, [dots, dots, dots, "", "target", dots, dots])', | |
703 \ 'normal gg', | |
704 \ 'redraw', | |
705 \ ], 'Xscript') | |
706 let buf = RunVimInTerminal('-S Xscript', {'rows': 9, 'cols': 70}) | |
707 " Need to send one key at a time to force a redraw | |
708 call term_sendkeys(buf, '/') | |
709 sleep 100m | |
710 call term_sendkeys(buf, 't') | |
711 sleep 100m | |
712 call term_sendkeys(buf, 'a') | |
713 sleep 100m | |
714 call term_sendkeys(buf, 'r') | |
715 sleep 100m | |
716 call term_sendkeys(buf, 'g') | |
717 call VerifyScreenDump(buf, 'Test_incsearch_scrolling_01', {}) | |
718 | |
719 call term_sendkeys(buf, "\<Esc>") | |
720 call StopVimInTerminal(buf) | |
721 call delete('Xscript') | |
722 endfunc | |
723 | |
693 func Test_search_undefined_behaviour() | 724 func Test_search_undefined_behaviour() |
694 if !has("terminal") | 725 if !has("terminal") |
695 return | 726 return |
696 endif | 727 endif |
697 let h = winheight(0) | 728 let h = winheight(0) |