updated for version 7.3.1037
Problem: Look-behind matching is very slow on long lines.
Solution: Add a byte limit to how far back an attempt is made.
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 9fb863a..88c813d 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -1331,6 +1331,16 @@
case '=':
EMIT(NFA_PREV_ATOM_NO_WIDTH);
break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
case '!':
case '<':
case '>':
@@ -3817,7 +3827,9 @@
* because recursive calls should only start in the first position.
* Also don't start a match past the first line. */
if (nfa_match == FALSE && start->c == NFA_MOPEN + 0
- && reglnum == 0 && clen != 0)
+ && reglnum == 0 && clen != 0
+ && (ireg_maxcol == 0
+ || (colnr_T)(reginput - regline) < ireg_maxcol))
{
#ifdef ENABLE_LOG
fprintf(log_fd, "(---) STARTSTATE\n");