patch 9.0.0950: the pattern "\_s\zs" matches at EOL
Problem: The pattern "\_s\zs" matches at EOL.
Solution: Make the pattern "\_s\zs" match at the start of the next line.
(closes #11617)
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index b829a3a..0228cfc 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -1742,7 +1742,8 @@
break;
}
}
- semsg(_(e_nfa_regexp_unknown_operator_percent_chr), no_Magic(c));
+ semsg(_(e_nfa_regexp_unknown_operator_percent_chr),
+ no_Magic(c));
return FAIL;
}
break;
@@ -4013,7 +4014,8 @@
for (j = 0; j < sub->in_use; j++)
if (REG_MULTI)
- fprintf(log_fd, "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n",
+ fprintf(log_fd,
+ "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n",
j,
sub->list.multi[j].start_col,
(int)sub->list.multi[j].start_lnum,
@@ -4790,7 +4792,7 @@
{
sub->list.multi[subidx].start_lnum = rex.lnum;
sub->list.multi[subidx].start_col =
- (colnr_T)(rex.input - rex.line + off);
+ (colnr_T)(rex.input - rex.line + off);
}
sub->list.multi[subidx].end_lnum = -1;
}
@@ -6243,7 +6245,7 @@
}
else if (!vim_iswordc_buf(curc, rex.reg_buf)
|| (rex.input > rex.line
- && vim_iswordc_buf(rex.input[-1], rex.reg_buf)))
+ && vim_iswordc_buf(rex.input[-1], rex.reg_buf)))
result = FALSE;
if (result)
{
@@ -6373,7 +6375,7 @@
case NFA_NEWL:
if (curc == NUL && !rex.reg_line_lbr && REG_MULTI
- && rex.lnum <= rex.reg_maxline)
+ && rex.lnum <= rex.reg_maxline)
{
go_to_nextline = TRUE;
// Pass -1 for the offset, which means taking the position
@@ -7025,7 +7027,7 @@
&& rex.lnum == 0
&& clen != 0
&& (rex.reg_maxcol == 0
- || (colnr_T)(rex.input - rex.line) < rex.reg_maxcol))
+ || (colnr_T)(rex.input - rex.line) < rex.reg_maxcol))
|| (nfa_endp != NULL
&& (REG_MULTI
? (rex.lnum < nfa_endp->se_u.pos.lnum