summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-03-19 17:41:23 +0100
committerBram Moolenaar <Bram@vim.org>2014-03-19 17:41:23 +0100
commit529d2d63699bd43fde8c04fd0c84fd7b3e6bf20a (patch)
tree9fb96c40bd643766f51e8f33d1a1b591f62dab66
parent2fb9fa19e2263f077163d0da844b637d0a356863 (diff)
downloadvim-git-529d2d63699bd43fde8c04fd0c84fd7b3e6bf20a.tar.gz
updated for version 7.4.209v7.4.209
Problem: When repeating a filter command "%" and "#" are expanded. Solution: Escape the command when storing for redo. (Christian Brabandt)
-rw-r--r--src/ex_cmds.c13
-rw-r--r--src/version.c2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 465fb9e43..fc83aba19 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -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;
}
diff --git a/src/version.c b/src/version.c
index 608ef8d7d..65fe16254 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 209,
+/**/
208,
/**/
207,