diff src/testdir/test_syntax.vim @ 29267:f27ec19f2034 v8.2.5152

patch 8.2.5152: search() gets stuck with "c" and skip evaluates to true Commit: https://github.com/vim/vim/commit/180246cfd1a5842c538fa8a4a0b520f1d95c90c7 Author: zeertzjq <zeertzjq@outlook.com> Date: Thu Jun 23 12:04:46 2022 +0100 patch 8.2.5152: search() gets stuck with "c" and skip evaluates to true Problem: search() gets stuck with "c" and skip evaluates to true. Solution: Reset the SEARCH_START option. (closes https://github.com/vim/vim/issues/10608)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Jun 2022 13:15:04 +0200
parents 947c8434894a
children 80929331a836
line wrap: on
line diff
--- a/src/testdir/test_syntax.vim
+++ b/src/testdir/test_syntax.vim
@@ -838,8 +838,9 @@ func Test_search_syntax_skip()
   1
   call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"')
   call assert_equal('Another Text for VIM', getline('.'))
+
   1
-  call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") !~? "string"')
+  call search('VIM', 'cw', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") !~? "string"')
   call assert_equal(' let a = "VIM"', getline('.'))
 
   " Skip argument using Lambda.
@@ -848,26 +849,27 @@ func Test_search_syntax_skip()
   call assert_equal('Another Text for VIM', getline('.'))
 
   1
-  call search('VIM', 'w', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") !~? "string"})
+  call search('VIM', 'cw', '', 0, { -> synIDattr(synID(line("."), col("."), 1), "name") !~? "string"})
   call assert_equal(' let a = "VIM"', getline('.'))
 
   " Skip argument using funcref.
   func InComment()
     return synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"
   endfunc
-  func InString()
+  func NotInString()
     return synIDattr(synID(line("."), col("."), 1), "name") !~? "string"
   endfunc
+
   1
   call search('VIM', 'w', '', 0, function('InComment'))
   call assert_equal('Another Text for VIM', getline('.'))
 
   1
-  call search('VIM', 'w', '', 0, function('InString'))
+  call search('VIM', 'cw', '', 0, function('NotInString'))
   call assert_equal(' let a = "VIM"', getline('.'))
 
   delfunc InComment
-  delfunc InString
+  delfunc NotInString
   bwipe!
 endfunc