mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.4.532
Problem: When using 'incsearch' "2/pattern/e" highlights the first match. Solution: Move the code to set extra_col inside the loop for count. (Ozaki Kiichi)
This commit is contained in:
22
src/search.c
22
src/search.c
@@ -552,6 +552,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
|
||||
int match_ok;
|
||||
long nmatched;
|
||||
int submatch = 0;
|
||||
int first_match = TRUE;
|
||||
int save_called_emsg = called_emsg;
|
||||
#ifdef FEAT_SEARCH_EXTRA
|
||||
int break_loop = FALSE;
|
||||
@@ -565,9 +566,15 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
/* When not accepting a match at the start position set "extra_col" to a
|
||||
* non-zero value. Don't do that when starting at MAXCOL, since MAXCOL +
|
||||
* 1 is zero. */
|
||||
/*
|
||||
* find the string
|
||||
*/
|
||||
called_emsg = FALSE;
|
||||
do /* loop for count */
|
||||
{
|
||||
/* When not accepting a match at the start position set "extra_col" to
|
||||
* a non-zero value. Don't do that when starting at MAXCOL, since
|
||||
* MAXCOL + 1 is zero. */
|
||||
if ((options & SEARCH_START) || pos->col == MAXCOL)
|
||||
extra_col = 0;
|
||||
#ifdef FEAT_MBYTE
|
||||
@@ -586,12 +593,6 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
|
||||
else
|
||||
extra_col = 1;
|
||||
|
||||
/*
|
||||
* find the string
|
||||
*/
|
||||
called_emsg = FALSE;
|
||||
do /* loop for count */
|
||||
{
|
||||
start_pos = *pos; /* remember start pos for detecting no match */
|
||||
found = 0; /* default: not found */
|
||||
at_first_line = TRUE; /* default: start in first line */
|
||||
@@ -677,7 +678,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
|
||||
* otherwise "/$" will get stuck on end of line.
|
||||
*/
|
||||
while (matchpos.lnum == 0
|
||||
&& ((options & SEARCH_END)
|
||||
&& ((options & SEARCH_END) && first_match
|
||||
? (nmatched == 1
|
||||
&& (int)endpos.col - 1
|
||||
< (int)start_pos.col + extra_col)
|
||||
@@ -908,6 +909,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
|
||||
pos->coladd = 0;
|
||||
#endif
|
||||
found = 1;
|
||||
first_match = FALSE;
|
||||
|
||||
/* Set variables used for 'incsearch' highlighting. */
|
||||
search_match_lines = endpos.lnum - matchpos.lnum;
|
||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
532,
|
||||
/**/
|
||||
531,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user