summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-04-03 21:14:29 +0200
committerBram Moolenaar <Bram@vim.org>2013-04-03 21:14:29 +0200
commit7bcb30e91387800261c0154c2d53b6118100dca0 (patch)
tree6b7d1b6c0cb7003626e7b7fe0af3a7b33e022091 /src/search.c
parentcdffbeae2b031160a479f24cfedacab926938e5d (diff)
downloadvim-git-7bcb30e91387800261c0154c2d53b6118100dca0.tar.gz
updated for version 7.3.877v7.3.877
Problem: Forward searching with search() is broken. Solution: Fix it and add tests. (Sung Pae)
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c
index 934e4b0cf..f9a5b84c0 100644
--- a/src/search.c
+++ b/src/search.c
@@ -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))
{