Mercurial > vim
comparison src/testdir/test_search.vim @ 14515:3648e74dd523 v8.1.0271
patch 8.1.0271: 'incsearch' doesn't work for :s, :g or :v
commit https://github.com/vim/vim/commit/b0acacd767a2b0618a7f3c08087708f4329580d0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 11 16:40:43 2018 +0200
patch 8.1.0271: 'incsearch' doesn't work for :s, :g or :v
Problem: 'incsearch' doesn't work for :s, :g or :v.
Solution: Also use 'incsearch' for other commands that use a pattern.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Aug 2018 16:45:05 +0200 |
parents | f8280e1bfc84 |
children | 97641c4f5687 |
comparison
equal
deleted
inserted
replaced
14514:7ac24a4dc6ea | 14515:3648e74dd523 |
---|---|
358 call assert_equal(' 2 the~e', getline('.')) | 358 call assert_equal(' 2 the~e', getline('.')) |
359 " clean up | 359 " clean up |
360 set noincsearch | 360 set noincsearch |
361 call test_override("char_avail", 0) | 361 call test_override("char_avail", 0) |
362 bw! | 362 bw! |
363 endfunc | |
364 | |
365 func Cmdline3_prep() | |
366 " need to disable char_avail, | |
367 " so that expansion of commandline works | |
368 call test_override("char_avail", 1) | |
369 new | |
370 call setline(1, [' 1', ' 2 the~e', ' 3 the theother']) | |
371 set incsearch | |
372 endfunc | |
373 | |
374 func Cmdline3_cleanup() | |
375 set noincsearch | |
376 call test_override("char_avail", 0) | |
377 bw! | |
378 endfunc | |
379 | |
380 func Test_search_cmdline3s() | |
381 if !exists('+incsearch') | |
382 return | |
383 endif | |
384 call Cmdline3_prep() | |
385 1 | |
386 call feedkeys(":%s/the\<c-l>/xxx\<cr>", 'tx') | |
387 call assert_equal(' 2 xxxe', getline('.')) | |
388 | |
389 call Cmdline3_cleanup() | |
390 endfunc | |
391 | |
392 func Test_search_cmdline3g() | |
393 if !exists('+incsearch') | |
394 return | |
395 endif | |
396 call Cmdline3_prep() | |
397 1 | |
398 call feedkeys(":g/the\<c-l>/d\<cr>", 'tx') | |
399 call assert_equal(' 3 the theother', getline(2)) | |
400 | |
401 call Cmdline3_cleanup() | |
402 endfunc | |
403 | |
404 func Test_search_cmdline3v() | |
405 if !exists('+incsearch') | |
406 return | |
407 endif | |
408 call Cmdline3_prep() | |
409 1 | |
410 call feedkeys(":v/the\<c-l>/d\<cr>", 'tx') | |
411 call assert_equal(1, line('$')) | |
412 call assert_equal(' 2 the~e', getline(1)) | |
413 | |
414 call Cmdline3_cleanup() | |
363 endfunc | 415 endfunc |
364 | 416 |
365 func Test_search_cmdline4() | 417 func Test_search_cmdline4() |
366 if !exists('+incsearch') | 418 if !exists('+incsearch') |
367 return | 419 return |