mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
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 #10608)
This commit is contained in:
@@ -8543,6 +8543,9 @@ search_cmn(typval_T *argvars, pos_T *match_pos, int *flagsp)
|
|||||||
if (!do_skip)
|
if (!do_skip)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear the start flag to avoid getting stuck here
|
||||||
|
options &= ~SEARCH_START;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subpatnum != FAIL)
|
if (subpatnum != FAIL)
|
||||||
|
@@ -838,8 +838,9 @@ func Test_search_syntax_skip()
|
|||||||
1
|
1
|
||||||
call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"')
|
call search('VIM', 'w', '', 0, 'synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"')
|
||||||
call assert_equal('Another Text for VIM', getline('.'))
|
call assert_equal('Another Text for VIM', getline('.'))
|
||||||
|
|
||||||
1
|
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('.'))
|
call assert_equal(' let a = "VIM"', getline('.'))
|
||||||
|
|
||||||
" Skip argument using Lambda.
|
" Skip argument using Lambda.
|
||||||
@@ -848,26 +849,27 @@ func Test_search_syntax_skip()
|
|||||||
call assert_equal('Another Text for VIM', getline('.'))
|
call assert_equal('Another Text for VIM', getline('.'))
|
||||||
|
|
||||||
1
|
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('.'))
|
call assert_equal(' let a = "VIM"', getline('.'))
|
||||||
|
|
||||||
" Skip argument using funcref.
|
" Skip argument using funcref.
|
||||||
func InComment()
|
func InComment()
|
||||||
return synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"
|
return synIDattr(synID(line("."), col("."), 1), "name") =~? "comment"
|
||||||
endfunc
|
endfunc
|
||||||
func InString()
|
func NotInString()
|
||||||
return synIDattr(synID(line("."), col("."), 1), "name") !~? "string"
|
return synIDattr(synID(line("."), col("."), 1), "name") !~? "string"
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
1
|
1
|
||||||
call search('VIM', 'w', '', 0, function('InComment'))
|
call search('VIM', 'w', '', 0, function('InComment'))
|
||||||
call assert_equal('Another Text for VIM', getline('.'))
|
call assert_equal('Another Text for VIM', getline('.'))
|
||||||
|
|
||||||
1
|
1
|
||||||
call search('VIM', 'w', '', 0, function('InString'))
|
call search('VIM', 'cw', '', 0, function('NotInString'))
|
||||||
call assert_equal(' let a = "VIM"', getline('.'))
|
call assert_equal(' let a = "VIM"', getline('.'))
|
||||||
|
|
||||||
delfunc InComment
|
delfunc InComment
|
||||||
delfunc InString
|
delfunc NotInString
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -734,6 +734,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
5152,
|
||||||
/**/
|
/**/
|
||||||
5151,
|
5151,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user