diff options
Diffstat (limited to 'src/nvim/screen.c')
-rw-r--r-- | src/nvim/screen.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 08bb4e4a52..5255fd2a51 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5651,13 +5651,15 @@ next_search_hl ( && cur != NULL && shl == &cur->hl && cur->match.regprog == cur->hl.rm.regprog); + int timed_out = false; - nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum, matchcol, &(shl->tm)); - /* Copy the regprog, in case it got freed and recompiled. */ + nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum, matchcol, + &(shl->tm), &timed_out); + // Copy the regprog, in case it got freed and recompiled. if (regprog_is_copy) { cur->match.regprog = cur->hl.rm.regprog; } - if (called_emsg || got_int) { + if (called_emsg || got_int || timed_out) { // Error while handling regexp: stop using this regexp. if (shl == &search_hl) { // don't free regprog in the match list, it's a copy |