]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.209 v7.4.209
authorBram Moolenaar <Bram@vim.org>
Wed, 19 Mar 2014 16:41:23 +0000 (17:41 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 19 Mar 2014 16:41:23 +0000 (17:41 +0100)
Problem:    When repeating a filter command "%" and "#" are expanded.
Solution:   Escape the command when storing for redo. (Christian Brabandt)

src/ex_cmds.c
src/version.c

index 465fb9e436cfda4c360e263664b3ff3b247c1d20..fc83aba19ed0de64b7e566741bccfb3a6dbe58fa 100644 (file)
@@ -1012,7 +1012,18 @@ do_bang(addr_count, eap, forceit, do_in, do_out)
 
     if (bangredo)          /* put cmd in redo buffer for ! command */
     {
-       AppendToRedobuffLit(prevcmd, -1);
+       /* If % or # appears in the command, it must have been escaped.
+        * Reescape them, so that redoing them does not substitute them by the
+        * buffername. */
+       char_u *cmd = vim_strsave_escaped(prevcmd, (char_u *)"%#");
+
+       if (cmd != NULL)
+       {
+           AppendToRedobuffLit(cmd, -1);
+           vim_free(cmd);
+       }
+       else
+           AppendToRedobuffLit(prevcmd, -1);
        AppendToRedobuff((char_u *)"\n");
        bangredo = FALSE;
     }
index 608ef8d7d2cf91ba0e3f461227f3511090091031..65fe16254f9b19718b29cc54b9672a9b44bb1054 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    209,
 /**/
     208,
 /**/