From 6019078ece008a53d6c4abfd822eeaf29b241b2d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar <Bram@vim.org> Date: Fri, 21 May 2010 13:08:58 +0200 Subject: [PATCH] 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. --- src/regexp.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } } -- GitLab