Mercurial > vim
diff src/search.c @ 4252:96f478b812b1 v7.3.877
updated for version 7.3.877
Problem: Forward searching with search() is broken.
Solution: Fix it and add tests. (Sung Pae)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 03 Apr 2013 21:14:29 +0200 |
parents | d52c45b35fb0 |
children | 04736b4030ec |
line wrap: on
line diff
--- a/src/search.c +++ b/src/search.c @@ -727,7 +727,7 @@ searchit(win, buf, pos, dir, pat, count, ++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, /* 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)) {