@@ -818,6 +818,41 @@ func Test_incsearch_substitute()
818818 call Incsearch_cleanup ()
819819endfunc
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 100 m
840+
841+ " Need to send one key at a time to force a redraw.
842+ call term_sendkeys (buf , ' :.,.+2s/' )
843+ sleep 100 m
844+ call term_sendkeys (buf , ' f' )
845+ sleep 100 m
846+ call term_sendkeys (buf , ' o' )
847+ sleep 100 m
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+
821856func Test_search_undefined_behaviour ()
822857 if ! has (" terminal" )
823858 return
0 commit comments