summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-01-19 14:59:58 +0000
committerBram Moolenaar <Bram@vim.org>2008-01-19 14:59:58 +0000
commit91a4e82243198d3c54b51296c532005daf5ccd3b (patch)
treec25223c268fa6be1229012ac34162233ef84e255 /src/search.c
parent4bad6c8d3dfe81d6171f20f1c3f7fc76bc2d89a7 (diff)
downloadvim-91a4e82243198d3c54b51296c532005daf5ccd3b.zip
updated for version 7.1-236
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/search.c b/src/search.c
index 035733b4a..4bbd3c33b 100644
--- a/src/search.c
+++ b/src/search.c
@@ -606,7 +606,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
* Look for a match somewhere in line "lnum".
*/
nmatched = vim_regexec_multi(&regmatch, win, buf,
- lnum, (colnr_T)0);
+ lnum, (colnr_T)0,
+#ifdef FEAT_RELTIME
+ tm
+#else
+ NULL
+#endif
+ );
/* Abort searching on an error (e.g., out of stack). */
if (called_emsg)
break;
@@ -615,9 +621,9 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
/* match may actually be in another line when using \zs */
matchpos = regmatch.startpos[0];
endpos = regmatch.endpos[0];
-# ifdef FEAT_EVAL
+#ifdef FEAT_EVAL
submatch = first_submatch(&regmatch);
-# endif
+#endif
/* Line me be past end of buffer for "\n\zs". */
if (lnum + matchpos.lnum > buf->b_ml.ml_line_count)
ptr = (char_u *)"";
@@ -693,7 +699,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
if (ptr[matchcol] == NUL
|| (nmatched = vim_regexec_multi(&regmatch,
win, buf, lnum + matchpos.lnum,
- matchcol)) == 0)
+ matchcol,
+#ifdef FEAT_RELTIME
+ tm
+#else
+ NULL
+#endif
+ )) == 0)
{
match_ok = FALSE;
break;
@@ -799,7 +811,13 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
if (ptr[matchcol] == NUL
|| (nmatched = vim_regexec_multi(&regmatch,
win, buf, lnum + matchpos.lnum,
- matchcol)) == 0)
+ matchcol,
+#ifdef FEAT_RELTIME
+ tm
+#else
+ NULL
+#endif
+ )) == 0)
break;
/* Need to get the line pointer again, a
@@ -977,12 +995,13 @@ first_submatch(rp)
* return 0 for failure, 1 for found, 2 for found and line offset added
*/
int
-do_search(oap, dirc, pat, count, options)
+do_search(oap, dirc, pat, count, options, tm)
oparg_T *oap; /* can be NULL */
int dirc; /* '/' or '?' */
char_u *pat;
long count;
int options;
+ proftime_T *tm; /* timeout limit or NULL */
{
pos_T pos; /* position of the last match */
char_u *searchstr;
@@ -1256,7 +1275,7 @@ do_search(oap, dirc, pat, count, options)
(SEARCH_KEEP + SEARCH_PEEK + SEARCH_HIS
+ SEARCH_MSG + SEARCH_START
+ ((pat != NULL && *pat == ';') ? 0 : SEARCH_NOOF))),
- RE_LAST, (linenr_T)0, NULL);
+ RE_LAST, (linenr_T)0, tm);
if (dircp != NULL)
*dircp = dirc; /* restore second '/' or '?' for normal_cmd() */