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:
@@ -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(®match,
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user