@@ -342,26 +342,6 @@ func Test_searchc()
342342 bw !
343343endfunc
344344
345- func Test_search_cmdline3 ()
346- if ! exists (' +incsearch' )
347- return
348- endif
349- " need to disable char_avail,
350- " so that expansion of commandline works
351- call test_override (" char_avail" , 1 )
352- new
353- call setline (1 , [' 1' , ' 2 the~e' , ' 3 the theother' ])
354- set incsearch
355- 1
356- " first match
357- call feedkeys (" /the\<c-l>\<cr> " , ' tx' )
358- call assert_equal (' 2 the~e' , getline (' .' ))
359- " clean up
360- set noincsearch
361- call test_override (" char_avail" , 0 )
362- bw !
363- endfunc
364-
365345func Cmdline3_prep ()
366346 " need to disable char_avail,
367347 " so that expansion of commandline works
@@ -377,6 +357,19 @@ func Cmdline3_cleanup()
377357 bw !
378358endfunc
379359
360+ func Test_search_cmdline3 ()
361+ if ! exists (' +incsearch' )
362+ return
363+ endif
364+ call Cmdline3_prep ()
365+ 1
366+ " first match
367+ call feedkeys (" /the\<c-l>\<cr> " , ' tx' )
368+ call assert_equal (' 2 the~e' , getline (' .' ))
369+
370+ call Cmdline3_cleanup ()
371+ endfunc
372+
380373func Test_search_cmdline3s ()
381374 if ! exists (' +incsearch' )
382375 return
@@ -385,6 +378,12 @@ func Test_search_cmdline3s()
385378 1
386379 call feedkeys (" :%s/the\<c-l> /xxx\<cr> " , ' tx' )
387380 call assert_equal (' 2 xxxe' , getline (' .' ))
381+ undo
382+ call feedkeys (" :%subs/the\<c-l> /xxx\<cr> " , ' tx' )
383+ call assert_equal (' 2 xxxe' , getline (' .' ))
384+ undo
385+ call feedkeys (" :%substitute/the\<c-l> /xxx\<cr> " , ' tx' )
386+ call assert_equal (' 2 xxxe' , getline (' .' ))
388387
389388 call Cmdline3_cleanup ()
390389endfunc
@@ -397,6 +396,9 @@ func Test_search_cmdline3g()
397396 1
398397 call feedkeys (" :g/the\<c-l> /d\<cr> " , ' tx' )
399398 call assert_equal (' 3 the theother' , getline (2 ))
399+ undo
400+ call feedkeys (" :global/the\<c-l> /d\<cr> " , ' tx' )
401+ call assert_equal (' 3 the theother' , getline (2 ))
400402
401403 call Cmdline3_cleanup ()
402404endfunc
@@ -410,6 +412,10 @@ func Test_search_cmdline3v()
410412 call feedkeys (" :v/the\<c-l> /d\<cr> " , ' tx' )
411413 call assert_equal (1 , line (' $' ))
412414 call assert_equal (' 2 the~e' , getline (1 ))
415+ undo
416+ call feedkeys (" :vglobal/the\<c-l> /d\<cr> " , ' tx' )
417+ call assert_equal (1 , line (' $' ))
418+ call assert_equal (' 2 the~e' , getline (1 ))
413419
414420 call Cmdline3_cleanup ()
415421endfunc
@@ -518,7 +524,7 @@ func Test_search_cmdline7()
518524 " so that expansion of commandline works
519525 call test_override (" char_avail" , 1 )
520526 new
521- let @/ = ' b'
527+ let @/ = ' b'
522528 call setline (1 , [' bbvimb' , ' ' ])
523529 set incsearch
524530 " first match
0 commit comments