diff options
author | Aufar Gilbran <aufargilbran@gmail.com> | 2020-08-19 00:51:38 +0800 |
---|---|---|
committer | Aufar Gilbran <aufargilbran@gmail.com> | 2020-09-11 10:37:52 +0800 |
commit | b0042cafc072c92e0db07cecb6ff03a9fc1df78e (patch) | |
tree | 65da48188c85fc6b64de14a95afd5c9ef2adc468 /src/nvim/testdir | |
parent | e2dc2a6bd751f5614fb7f51a2bd1bc28c3bf4530 (diff) | |
download | rneovim-b0042cafc072c92e0db07cecb6ff03a9fc1df78e.tar.gz rneovim-b0042cafc072c92e0db07cecb6ff03a9fc1df78e.tar.bz2 rneovim-b0042cafc072c92e0db07cecb6ff03a9fc1df78e.zip |
vim-patch:8.1.0356: using :s with 'incsearch' prevents CTRL-R CTRL-W
Problem: Using :s with 'incsearch' prevents CTRL-R CTRL-W. (Boris Staletic)
Solution: When past the pattern put cursor back in the start position.
(closes vim/vim#3413)
https://github.com/vim/vim/commit/99f043a57d0be35ef72572b0429cf51525c3cd2b
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_search.vim | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim index dd13baec66..8741def3bf 100644 --- a/src/nvim/testdir/test_search.vim +++ b/src/nvim/testdir/test_search.vim @@ -801,6 +801,44 @@ func Test_keep_last_search_pattern() set noincsearch endfunc +func Test_word_under_cursor_after_match() + throw 'skipped: Nvim does not support test_override()' + if !exists('+incsearch') + return + endif + new + call setline(1, 'foo bar') + set incsearch + call test_override("char_avail", 1) + try + call feedkeys("/foo\<C-R>\<C-W>\<CR>", 'ntx') + catch /E486:/ + endtry + call assert_equal('foobar', @/) + + bwipe! + call test_override("ALL", 0) + set noincsearch +endfunc + +func Test_subst_word_under_cursor() + throw 'skipped: Nvim does not support test_override()' + if !exists('+incsearch') + return + endif + new + call setline(1, ['int SomeLongName;', 'for (xxx = 1; xxx < len; ++xxx)']) + set incsearch + call test_override("char_avail", 1) + call feedkeys("/LongName\<CR>", 'ntx') + call feedkeys(":%s/xxx/\<C-R>\<C-W>/g\<CR>", 'ntx') + call assert_equal('for (SomeLongName = 1; SomeLongName < len; ++SomeLongName)', getline(2)) + + bwipe! + call test_override("ALL", 0) + set noincsearch +endfunc + func Test_incsearch_with_change() if !has('timers') || !exists('+incsearch') || !CanRunVimInTerminal() throw 'Skipped: cannot make screendumps and/or timers feature and/or incsearch option missing' |