diff src/testdir/test_search.vim @ 28562:e96111a91a21 v8.2.4805

patch 8.2.4805: CurSearch used for all matches in current line Commit: https://github.com/vim/vim/commit/9b36750640e8e89f18afa1446ed80fdbdf0fcac0 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 22 20:07:21 2022 +0100 patch 8.2.4805: CurSearch used for all matches in current line Problem: CurSearch used for all matches in current line. Solution: Don't use the non-zero line count. (closes https://github.com/vim/vim/issues/10247)
author Bram Moolenaar <Bram@vim.org>
date Fri, 22 Apr 2022 21:15:05 +0200
parents 9ff0e5a29037
children a2710736125a
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -1043,7 +1043,7 @@ func Test_hlsearch_cursearch()
 
   let lines =<< trim END
     set hlsearch scrolloff=0
-    call setline(1, ['one', 'foo', 'bar', 'baz', 'foo', 'bar'])
+    call setline(1, ['one', 'foo', 'bar', 'baz', 'foo the foo and foo', 'bar'])
     hi Search ctermbg=yellow
     hi CurSearch ctermbg=blue
   END
@@ -1056,7 +1056,14 @@ func Test_hlsearch_cursearch()
   call term_sendkeys(buf, "n")
   call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2', {})
 
-  call term_sendkeys(buf, "?\<CR>")
+  call term_sendkeys(buf, "n")
+  call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2a', {})
+
+  call term_sendkeys(buf, "n")
+  call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_2b', {})
+
+  call term_sendkeys(buf, ":call setline(5, 'foo')\<CR>")
+  call term_sendkeys(buf, "0?\<CR>")
   call VerifyScreenDump(buf, 'Test_hlsearch_cursearch_single_line_3', {})
 
   call term_sendkeys(buf, "gg/foo\\nbar\<CR>")