aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-09-13 02:03:03 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-09-13 08:25:20 -0400
commit8105fc89c40cd702b44f53a979f17161318c1294 (patch)
tree815ad7d6a6e980e9104a1d1b6af9deae8291fe28 /src/nvim/testdir
parent25992df761f24546df69aa01fd03d0ae96e96fbe (diff)
downloadrneovim-8105fc89c40cd702b44f53a979f17161318c1294.tar.gz
rneovim-8105fc89c40cd702b44f53a979f17161318c1294.tar.bz2
rneovim-8105fc89c40cd702b44f53a979f17161318c1294.zip
vim-patch:8.1.1704: C-R C-W does not work after C-G when using 'incsearch'
Problem: C-R C-W does not work after C-G when using 'incsearch'. Solution: Put cursor at end of the match. (Yasuhiro Matsumoto, closes vim/vim#4664) https://github.com/vim/vim/commit/69a5b867940d25f68a782de5c1165d65b51fcafa
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_search.vim10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 01580d756c..e3a0fce5a6 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -244,6 +244,10 @@ func Test_search_cmdline2()
" go to previous match (on line 2)
call feedkeys("/the\<C-G>\<C-G>\<C-G>\<C-T>\<C-T>\<C-T>\<cr>", 'tx')
call assert_equal(' 2 these', getline('.'))
+ 1
+ " go to previous match (on line 2)
+ call feedkeys("/the\<C-G>\<C-R>\<C-W>\<cr>", 'tx')
+ call assert_equal('theother', @/)
" Test 2: keep the view,
" after deleting a character from the search cmd
@@ -255,7 +259,7 @@ func Test_search_cmdline2()
call assert_equal({'lnum': 10, 'leftcol': 0, 'col': 4, 'topfill': 0, 'topline': 6, 'coladd': 0, 'skipcol': 0, 'curswant': 4}, winsaveview())
" remove all history entries
- for i in range(10)
+ for i in range(11)
call histdel('/')
endfor
@@ -489,14 +493,14 @@ func Test_search_cmdline5()
" Do not call test_override("char_avail", 1) so that <C-g> and <C-t> work
" regardless char_avail.
new
- call setline(1, [' 1 the first', ' 2 the second', ' 3 the third'])
+ call setline(1, [' 1 the first', ' 2 the second', ' 3 the third', ''])
set incsearch
1
call feedkeys("/the\<c-g>\<c-g>\<cr>", 'tx')
call assert_equal(' 3 the third', getline('.'))
$
call feedkeys("?the\<c-t>\<c-t>\<c-t>\<cr>", 'tx')
- call assert_equal(' 2 the second', getline('.'))
+ call assert_equal(' 1 the first', getline('.'))
" clean up
set noincsearch
bw!