diff src/testdir/test_search.vim @ 16287:a6cffc232b9d v8.1.1148

patch 8.1.1148: CTRL-L with 'incsearch' does not pick up char under cursor commit https://github.com/vim/vim/commit/730f48fe3691dc62331f3df23cb947bfc33a5add Author: Bram Moolenaar <Bram@vim.org> Date: Thu Apr 11 13:45:57 2019 +0200 patch 8.1.1148: CTRL-L with 'incsearch' does not pick up char under cursor Problem: CTRL-L with 'incsearch' does not pick up char under cursor. (Smylers) Solution: Do not compare the position with the cursor position. (Hirohito Higashi, closes #3620)
author Bram Moolenaar <Bram@vim.org>
date Thu, 11 Apr 2019 14:00:05 +0200
parents 4feaa025491b
children aebcd20a8a3f
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -1248,3 +1248,20 @@ func Test_one_error_msg()
   " This  was also giving an internal error
   call assert_fails('call search(" \\((\\v[[=P=]]){185}+             ")', 'E871:')
 endfunc
+
+func Test_incsearch_add_char_under_cursor()
+  if !exists('+incsearch')
+    return
+  endif
+  set incsearch
+  new
+  call setline(1, ['find match', 'anything'])
+  1
+  call test_override('char_avail', 1)
+  call feedkeys("fc/m\<C-L>\<C-L>\<C-L>\<C-L>\<C-L>\<CR>", 'tx')
+  call assert_equal('match', @/)
+  call test_override('char_avail', 0)
+
+  set incsearch&
+  bwipe!
+endfunc