Mercurial > vim
changeset 5310:b04bdb2c5fce v7.4.008
updated for version 7.4.008
Problem: New regexp engine can't be interrupted.
Solution: Check for CTRL-C pressed. (Yasuhiro Matsumoto)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 25 Aug 2013 17:01:42 +0200 |
parents | 2ee5e568766c |
children | e1d46e65db2f |
files | src/regexp.c src/regexp_nfa.c src/version.c |
diffstat | 3 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/regexp.c +++ b/src/regexp.c @@ -4311,8 +4311,8 @@ regmatch(scan) */ for (;;) { - /* Some patterns may cause a long time to match, even though they are not - * illegal. E.g., "\([a-z]\+\)\+Q". Allow breaking them with CTRL-C. */ + /* Some patterns may take a long time to match, e.g., "\([a-z]\+\)\+Q". + * Allow interrupting them with CTRL-C. */ fast_breakcheck(); #ifdef DEBUG
--- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -5089,6 +5089,12 @@ nfa_regmatch(prog, start, submatch, m) return FALSE; } #endif + /* Some patterns may take a long time to match, especially when using + * recursive_regmatch(). Allow interrupting them with CTRL-C. */ + fast_breakcheck(); + if (got_int) + return FALSE; + nfa_match = FALSE; /* Allocate memory for the lists of nodes. */