]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.437
authorBram Moolenaar <Bram@vim.org>
Fri, 21 May 2010 11:08:58 +0000 (13:08 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 21 May 2010 11:08:58 +0000 (13:08 +0200)
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

index 216bf3a18e2586046a03d5608e9ad904fbba14b2..53559455e0cfd372d295a6d14ccb64771b48d926 100644 (file)
@@ -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;
                    }
                }