1
0
forked from aniani/vim

updated for version 7.3.1088

Problem:    New regexp engine: \@<= and \@<! are not implemented.
Solution:   Implement look-behind matching.  Fix off-by-one error in old
            regexp engine.
This commit is contained in:
Bram Moolenaar
2013-06-01 19:54:43 +02:00
parent 543b7ef700
commit 61602c5bfe
5 changed files with 189 additions and 51 deletions

View File

@@ -5576,7 +5576,14 @@ regmatch(scan)
limit = OPERAND_MIN(rp->rs_scan);
if (REG_MULTI)
{
if (rp->rs_un.regsave.rs_u.pos.col == 0)
if (limit > 0
&& ((rp->rs_un.regsave.rs_u.pos.lnum
< behind_pos.rs_u.pos.lnum
? (colnr_T)STRLEN(regline)
: behind_pos.rs_u.pos.col)
- rp->rs_un.regsave.rs_u.pos.col >= limit))
no = FAIL;
else if (rp->rs_un.regsave.rs_u.pos.col == 0)
{
if (rp->rs_un.regsave.rs_u.pos.lnum
< behind_pos.rs_u.pos.lnum
@@ -5601,13 +5608,6 @@ regmatch(scan)
else
#endif
--rp->rs_un.regsave.rs_u.pos.col;
if (limit > 0
&& ((rp->rs_un.regsave.rs_u.pos.lnum
< behind_pos.rs_u.pos.lnum
? (colnr_T)STRLEN(regline)
: behind_pos.rs_u.pos.col)
- rp->rs_un.regsave.rs_u.pos.col > limit))
no = FAIL;
}
}
else