summaryrefslogtreecommitdiffstats
path: root/src/proto/search.pro
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-17 18:44:21 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-17 18:44:21 +0200
commitfbd0b0af6800f6ff89857863d6a07ea03f09ff6c (patch)
treed970232ff584511e30efcfe2f7ea5eefb9e9f8d4 /src/proto/search.pro
parent8cf91286ca46a501d24e4b7d631b193256782c88 (diff)
patch 8.0.0643: when a pattern search is slow Vim becomes unusablev8.0.0643
Problem: When 'hlsearch' is set and matching with the last search pattern is very slow, Vim becomes unusable. Cannot quit search by pressing CTRL-C. Solution: When the search times out set a flag and don't try again. Check for timeout and CTRL-C in NFA loop that adds states.
Diffstat (limited to 'src/proto/search.pro')
-rw-r--r--src/proto/search.pro4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/proto/search.pro b/src/proto/search.pro
index 3b9ca5c74a..63955adee0 100644
--- a/src/proto/search.pro
+++ b/src/proto/search.pro
@@ -19,9 +19,9 @@ char_u *last_search_pat(void);
void reset_search_dir(void);
void set_last_search_pat(char_u *s, int idx, int magic, int setlast);
void last_pat_prog(regmmatch_T *regmatch);
-int searchit(win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *pat, long count, int options, int pat_use, linenr_T stop_lnum, proftime_T *tm);
+int searchit(win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *pat, long count, int options, int pat_use, linenr_T stop_lnum, proftime_T *tm, int *timed_out);
void set_search_direction(int cdir);
-int do_search(oparg_T *oap, int dirc, char_u *pat, long count, int options, proftime_T *tm);
+int do_search(oparg_T *oap, int dirc, char_u *pat, long count, int options, proftime_T *tm, int *timed_out);
int search_for_exact_line(buf_T *buf, pos_T *pos, int dir, char_u *pat);
int searchc(cmdarg_T *cap, int t_cmd);
pos_T *findmatch(oparg_T *oap, int initc);