Skip to content

Commit 164251f

Browse files
committed
patch 8.1.0276: no test for 'incsearch' highlighting with :s
Problem: No test for 'incsearch' highlighting with :s. Solution: Add a screendump test.
1 parent 976b847 commit 164251f

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
|f+0&#ffffff0|o@1| |1| @64
2+
|f|o@1| |2| @64
3+
|f+1&&|o@1| +0&&|3| @64
4+
|f+0&#ffff4012|o@1| +0&#ffffff0|4| @64
5+
|f+0&#ffff4012|o@1| +0&#ffffff0|5| @64
6+
|f|o@1| |6| @64
7+
|f|o@1| |7| @64
8+
|f|o@1| |8| @64
9+
|:|.|,|.|+|2|s|/|f|o@1> @58

src/testdir/test_search.vim

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,41 @@ func Test_incsearch_substitute()
818818
call Incsearch_cleanup()
819819
endfunc
820820

821+
" Similar to Test_incsearch_substitute() but with a screendump halfway.
822+
func Test_incsearch_substitute_dump()
823+
if !exists('+incsearch')
824+
return
825+
endif
826+
if !CanRunVimInTerminal()
827+
return
828+
endif
829+
call writefile([
830+
\ 'set incsearch hlsearch scrolloff=0',
831+
\ 'for n in range(1, 10)',
832+
\ ' call setline(n, "foo " . n)',
833+
\ 'endfor',
834+
\ '3',
835+
\ ], 'Xis_subst_script')
836+
let buf = RunVimInTerminal('-S Xis_subst_script', {'rows': 9, 'cols': 70})
837+
" Give Vim a chance to redraw to get rid of the spaces in line 2 caused by
838+
" the 'ambiwidth' check.
839+
sleep 100m
840+
841+
" Need to send one key at a time to force a redraw.
842+
call term_sendkeys(buf, ':.,.+2s/')
843+
sleep 100m
844+
call term_sendkeys(buf, 'f')
845+
sleep 100m
846+
call term_sendkeys(buf, 'o')
847+
sleep 100m
848+
call term_sendkeys(buf, 'o')
849+
call VerifyScreenDump(buf, 'Test_incsearch_substitute_01', {})
850+
851+
call term_sendkeys(buf, "\<Esc>")
852+
call StopVimInTerminal(buf)
853+
call delete('Xis_subst_script')
854+
endfunc
855+
821856
func Test_search_undefined_behaviour()
822857
if !has("terminal")
823858
return

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ static char *(features[]) =
794794

795795
static int included_patches[] =
796796
{ /* Add new patch number below this line */
797+
/**/
798+
276,
797799
/**/
798800
275,
799801
/**/

0 commit comments

Comments
 (0)