diff src/testdir/test_search.vim @ 24693:97789fcef0cf v8.2.2885

patch 8.2.2885: searching for %'> does not match linewise end of line Commit: https://github.com/vim/vim/commit/872bee557e5f8ab0e4a523a6a845868a2801b17e Author: Bram Moolenaar <Bram@vim.org> Date: Mon May 24 22:56:15 2021 +0200 patch 8.2.2885: searching for \%'> does not match linewise end of line Problem: searching for \%'> does not match linewise end of line. (Tim Chase) Solution: Match end of line if column is MAXCOL. (closes https://github.com/vim/vim/issues/8238)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 May 2021 23:00:03 +0200
parents e3efa11b6a1e
children b1fa3f005c93
line wrap: on
line diff
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -1332,13 +1332,28 @@ func Test_look_behind()
   bwipe!
 endfunc
 
+func Test_search_visual_area_linewise()
+  new
+  call setline(1, ['aa', 'bb', 'cc'])
+  exe "normal 2GV\<Esc>"
+  for engine in [1, 2]
+    exe 'set regexpengine=' .. engine
+    exe "normal gg/\\%'<\<CR>>"
+    call assert_equal([0, 2, 1, 0, 1], getcurpos(), 'engine ' .. engine)
+    exe "normal gg/\\%'>\<CR>"
+    call assert_equal([0, 2, 2, 0, 2], getcurpos(), 'engine ' .. engine)
+  endfor
+
+  bwipe!
+  set regexpengine&
+endfunc
+
 func Test_search_sentence()
   new
   " this used to cause a crash
-  call assert_fails("/\\%')", 'E486:')
-  call assert_fails("/", 'E486:')
   /\%'(
   /
+  bwipe
 endfunc
 
 " Test that there is no crash when there is a last search pattern but no last