diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/regexp_nfa.c | 19 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index 3daf6a8544..21feb87ae1 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -5737,12 +5737,21 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm case NFA_VCOL_GT: case NFA_VCOL_LT: { + int op = t->state->c - NFA_VCOL; + colnr_T col = (colnr_T)(reginput - regline); + + // Bail out quickly when there can't be a match, avoid the overhead of + // win_linetabsize() on long lines. + if ((col > t->state->val && op != 1) + || (col - 1 > t->state->val && op == 1)) { + break; + } uintmax_t lts = win_linetabsize(reg_win == NULL ? curwin : reg_win, regline, - (colnr_T)(reginput - regline)); + col); assert(t->state->val >= 0); result = nfa_re_num_cmp((uintmax_t)t->state->val, - t->state->c - NFA_VCOL, + op, lts + 1); if (result) { add_here = TRUE; @@ -6023,6 +6032,12 @@ nextchar: reg_nextline(); else break; + + // Allow interrupting with CTRL-C. + fast_breakcheck(); + if (got_int) { + break; + } } #ifdef REGEXP_DEBUG diff --git a/src/nvim/version.c b/src/nvim/version.c index e3c2ee9e99..e786b2ffca 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -206,7 +206,7 @@ static int included_patches[] = { 580, //579, 578, - //577, + 577, 576, //575, 574, |