diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-06-01 19:54:43 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-06-01 19:54:43 +0200 |
commit | 61602c5bfe7d4a4a0a6671b132f5b98d7d9da424 (patch) | |
tree | fda5a8fcf6a325647deaf4b25c5071bbe8b5357c /src/regexp.c | |
parent | 543b7ef7000d08d77409478315d68b607bb8bad8 (diff) | |
download | vim-git-61602c5bfe7d4a4a0a6671b132f5b98d7d9da424.tar.gz |
updated for version 7.3.1088v7.3.1088
Problem: New regexp engine: \@<= and \@<! are not implemented.
Solution: Implement look-behind matching. Fix off-by-one error in old
regexp engine.
Diffstat (limited to 'src/regexp.c')
-rw-r--r-- | src/regexp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/regexp.c b/src/regexp.c index cfeee4c27..3eaf74dd9 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -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 |