aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorAufar Gilbran <aufargilbran@gmail.com>2020-08-10 03:02:54 +0800
committerAufar Gilbran <aufargilbran@gmail.com>2020-09-11 10:31:41 +0800
commite8a8b9ed08405c830a049c4e43910c5ce9cdb669 (patch)
treeade437e15fd6e6b0fd67cea690717d0061385a39 /src/nvim/testdir
parent8ac47485777c2eaee9fe7aa93d1ed6c5748d2da9 (diff)
downloadrneovim-e8a8b9ed08405c830a049c4e43910c5ce9cdb669.tar.gz
rneovim-e8a8b9ed08405c830a049c4e43910c5ce9cdb669.tar.bz2
rneovim-e8a8b9ed08405c830a049c4e43910c5ce9cdb669.zip
vim-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. https://github.com/vim/vim/commit/b0acacd767a2b0618a7f3c08087708f4329580d0
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_search.vim57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 8036dea29f..087a261cca 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -367,6 +367,63 @@ func Test_search_cmdline3()
bw!
endfunc
+func Cmdline3_prep()
+ throw 'skipped: Nvim does not support test_override()'
+ " need to disable char_avail,
+ " so that expansion of commandline works
+ call test_override("char_avail", 1)
+ new
+ call setline(1, [' 1', ' 2 the~e', ' 3 the theother'])
+ set incsearch
+endfunc
+
+func Cmdline3_cleanup()
+ throw 'skipped: Nvim does not support test_override()'
+ set noincsearch
+ call test_override("char_avail", 0)
+ bw!
+endfunc
+
+func Test_search_cmdline3s()
+ throw 'skipped: Nvim does not support test_override()'
+ if !exists('+incsearch')
+ return
+ endif
+ call Cmdline3_prep()
+ 1
+ call feedkeys(":%s/the\<c-l>/xxx\<cr>", 'tx')
+ call assert_equal(' 2 xxxe', getline('.'))
+
+ call Cmdline3_cleanup()
+endfunc
+
+func Test_search_cmdline3g()
+ throw 'skipped: Nvim does not support test_override()'
+ if !exists('+incsearch')
+ return
+ endif
+ call Cmdline3_prep()
+ 1
+ call feedkeys(":g/the\<c-l>/d\<cr>", 'tx')
+ call assert_equal(' 3 the theother', getline(2))
+
+ call Cmdline3_cleanup()
+endfunc
+
+func Test_search_cmdline3v()
+ throw 'skipped: Nvim does not support test_override()'
+ if !exists('+incsearch')
+ return
+ endif
+ call Cmdline3_prep()
+ 1
+ call feedkeys(":v/the\<c-l>/d\<cr>", 'tx')
+ call assert_equal(1, line('$'))
+ call assert_equal(' 2 the~e', getline(1))
+
+ call Cmdline3_cleanup()
+endfunc
+
func Test_search_cmdline4()
" See test/functional/legacy/search_spec.lua
throw 'skipped: Nvim does not support test_override()'