diff src/testdir/test_search.vim @ 14542:116a01c73fd8 v8.1.0284

patch 8.1.0284: 'cursorline' highlighting wrong with 'incsearch' commit https://github.com/vim/vim/commit/2f6a346a4cd2d5bdd6dc9b3209ebce7b6340221d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Aug 14 18:16:52 2018 +0200 patch 8.1.0284: 'cursorline' highlighting wrong with 'incsearch' Problem: 'cursorline' highlighting wrong with 'incsearch'. Solution: Move the cursor back if the match is outside the range.
author Christian Brabandt <cb@256bit.org>
date Tue, 14 Aug 2018 18:30:06 +0200
parents 213f1a519378
children 35e7ead872db
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -839,6 +839,7 @@ func Test_incsearch_substitute_dump()
 	\ 'for n in range(1, 10)',
 	\ '  call setline(n, "foo " . n)',
 	\ 'endfor',
+	\ 'call setline(11, "bar 11")',
 	\ '3',
 	\ ], 'Xis_subst_script')
   let buf = RunVimInTerminal('-S Xis_subst_script', {'rows': 9, 'cols': 70})
@@ -890,6 +891,20 @@ func Test_incsearch_substitute_dump()
   call VerifyScreenDump(buf, 'Test_incsearch_substitute_06', {})
   call term_sendkeys(buf, "\<Esc>")
 
+  " Cursorline highlighting at match
+  call term_sendkeys(buf, ":set cursorline\<CR>")
+  call term_sendkeys(buf, 'G9G')
+  call term_sendkeys(buf, ':9,11s/bar')
+  sleep 100m
+  call VerifyScreenDump(buf, 'Test_incsearch_substitute_07', {})
+  call term_sendkeys(buf, "\<Esc>")
+
+  " Cursorline highlighting at cursor when no match
+  call term_sendkeys(buf, ':9,10s/bar')
+  sleep 100m
+  call VerifyScreenDump(buf, 'Test_incsearch_substitute_08', {})
+  call term_sendkeys(buf, "\<Esc>")
+
   call StopVimInTerminal(buf)
   call delete('Xis_subst_script')
 endfunc