summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-05-21 13:08:58 +0200
committerBram Moolenaar <Bram@vim.org>2010-05-21 13:08:58 +0200
commit6019078ece008a53d6c4abfd822eeaf29b241b2d (patch)
tree24171304ec256cd6fbfdbe558876b88600247cc0
parent7a329911b9ae2b97453fd995bc3a6523cf3aab53 (diff)
updated for version 7.2.437
Problem: When "\\\n" appears in the expression result the \n doesn't result in a line break. (Andy Wokula) Solution: Also replace a \n after a backslash into \r.
-rw-r--r--src/regexp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 216bf3a18e..53559455e0 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -6974,6 +6974,13 @@ vim_regsub_both(source, dest, copy, magic, backslash)
else if (*s == '\\' && s[1] != NUL)
{
++s;
+ /* Change NL to CR here too, so that this works:
+ * :s/abc\\\ndef/\="aaa\\\nbbb"/ on text:
+ * abc\
+ * def
+ */
+ if (*s == NL)
+ *s = CAR;
had_backslash = TRUE;
}
}