diff src/regexp_nfa.c @ 8021:b6b4f354df23 v7.4.1305

commit https://github.com/vim/vim/commit/7c29f387819b5817b003d2ba73e2b5cf3cb3d0dd Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 12 19:08:15 2016 +0100 patch 7.4.1305 Problem: "\%1l^#.*" does not match on a line starting with "#". Solution: Do not clear the start-of-line flag. (Christian Brabandt)
author Christian Brabandt <cb@256bit.org>
date Fri, 12 Feb 2016 19:15:05 +0100
parents c079097365f3
children f196308a2813
line wrap: on
line diff
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -1128,6 +1128,7 @@ nfa_regatom(void)
     int		startc = -1;
     int		endc = -1;
     int		oldstartc = -1;
+    int		save_prev_at_start = prev_at_start;
 
     c = getchr();
     switch (c)
@@ -1467,9 +1468,13 @@ nfa_regatom(void)
 			if (c == 'l' || c == 'c' || c == 'v')
 			{
 			    if (c == 'l')
+			    {
 				/* \%{n}l  \%{n}<l  \%{n}>l  */
 				EMIT(cmp == '<' ? NFA_LNUM_LT :
 				     cmp == '>' ? NFA_LNUM_GT : NFA_LNUM);
+				if (save_prev_at_start)
+				    at_start = TRUE;
+			    }
 			    else if (c == 'c')
 				/* \%{n}c  \%{n}<c  \%{n}>c  */
 				EMIT(cmp == '<' ? NFA_COL_LT :