summaryrefslogtreecommitdiff
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-11-21 17:13:00 +0100
committerBram Moolenaar <Bram@vim.org>2013-11-21 17:13:00 +0100
commit438ee5bf603f3cee2c8ec924d081885c0086ba19 (patch)
treed39bb63d5cbe3a7b73563977647e07f91e36afeb /src/regexp.c
parent272fb5823627e2e088b8f39ea516fc8a9341572e (diff)
downloadvim-git-438ee5bf603f3cee2c8ec924d081885c0086ba19.tar.gz
updated for version 7.4.101v7.4.101
Problem: Using \1 in pattern goes one line too far. (Bohr Shaw, John Little) Solution: Only advance the match end for the matched characters in the last line.
Diffstat (limited to 'src/regexp.c')
-rw-r--r--src/regexp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 075374d16..f1e8909b2 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -6455,7 +6455,8 @@ re_num_cmp(val, scan)
/*
* Check whether a backreference matches.
* Returns RA_FAIL, RA_NOMATCH or RA_MATCH.
- * If "bytelen" is not NULL, it is set to the bytelength of the whole match.
+ * If "bytelen" is not NULL, it is set to the byte length of the match in the
+ * last line.
*/
static int
match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen)
@@ -6511,6 +6512,8 @@ match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen)
/* Advance to next line. */
reg_nextline();
+ if (bytelen != NULL)
+ *bytelen = 0;
++clnum;
ccol = 0;
if (got_int)