summaryrefslogtreecommitdiff
path: root/src/proto
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
parent8cf91286ca46a501d24e4b7d631b193256782c88 (diff)
downloadvim-git-fbd0b0af6800f6ff89857863d6a07ea03f09ff6c.tar.gz
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')
-rw-r--r--src/proto/regexp.pro2
-rw-r--r--src/proto/search.pro4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/proto/regexp.pro b/src/proto/regexp.pro
index dfe5c91d5..d22a83b0e 100644
--- a/src/proto/regexp.pro
+++ b/src/proto/regexp.pro
@@ -16,5 +16,5 @@ void vim_regfree(regprog_T *prog);
int vim_regexec_prog(regprog_T **prog, int ignore_case, char_u *line, colnr_T col);
int vim_regexec(regmatch_T *rmp, char_u *line, colnr_T col);
int vim_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col);
-long vim_regexec_multi(regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm);
+long vim_regexec_multi(regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm, int *timed_out);
/* vim: set ft=c : */
diff --git a/src/proto/search.pro b/src/proto/search.pro
index 3b9ca5c74..63955adee 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);