1
0
forked from aniani/vim

updated for version 7.3.877

Problem:    Forward searching with search() is broken.
Solution:   Fix it and add tests. (Sung Pae)
This commit is contained in:
Bram Moolenaar
2013-04-03 21:14:29 +02:00
parent cdffbeae2b
commit 7bcb30e913
4 changed files with 9 additions and 2 deletions

View File

@@ -727,7 +727,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
++matchcol;
}
}
if (options & SEARCH_START)
if (matchcol == 0 && (options & SEARCH_START))
break;
if (ptr[matchcol] == NUL
|| (nmatched = vim_regexec_multi(&regmatch,
@@ -869,7 +869,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
/* With the SEARCH_END option move to the last character
* of the match. Don't do it for an empty match, end
* should be same as start then. */
if (options & SEARCH_END && !(options & SEARCH_NOOF)
if ((options & SEARCH_END) && !(options & SEARCH_NOOF)
&& !(matchpos.lnum == endpos.lnum
&& matchpos.col == endpos.col))
{