changeset 2203:dde812fb2247 vim73

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.
author Bram Moolenaar <bram@vim.org>
date Fri, 21 May 2010 13:08:58 +0200
parents f7579a31705c
children c493d6bfde09
files src/regexp.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -6974,6 +6974,13 @@ vim_regsub_both(source, dest, copy, magi
 		    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;
 		    }
 		}