diff options
author | oni-link <knil.ino@gmail.com> | 2014-04-13 00:52:08 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-14 18:19:10 -0300 |
commit | 421c388bb77f19a5be3c987393ada1a8e5c8ea66 (patch) | |
tree | 7a8b7b908b20b3acd6e02adf105aeb003c3884f0 /src | |
parent | 4a131432636f5e5ace61eb622eefef442931da7d (diff) | |
download | rneovim-421c388bb77f19a5be3c987393ada1a8e5c8ea66.tar.gz rneovim-421c388bb77f19a5be3c987393ada1a8e5c8ea66.tar.bz2 rneovim-421c388bb77f19a5be3c987393ada1a8e5c8ea66.zip |
vim-patch:7.4.209
Problem: When repeating a filter command "%" and "#" are expanded.
Solution: Escape the command when storing for redo. (Christian Brabandt)
https://code.google.com/p/vim/source/detail?r=bb402c49379de97fcd475fbbbbdc5ed41e5dff07
Diffstat (limited to 'src')
-rw-r--r-- | src/ex_cmds.c | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 9c843137f6..02bb65f13e 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -930,8 +930,14 @@ void do_bang(int addr_count, exarg_T *eap, int forceit, int do_in, int do_out) vim_free(prevcmd); prevcmd = newcmd; - if (bangredo) { /* put cmd in redo buffer for ! command */ - AppendToRedobuffLit(prevcmd, -1); + if (bangredo) { /* put cmd in redo buffer for ! command */ + /* 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 *)"%#"); + + AppendToRedobuffLit(cmd, -1); + vim_free(cmd); AppendToRedobuff((char_u *)"\n"); bangredo = FALSE; } diff --git a/src/version.c b/src/version.c index 2ed38e0650..6502a98e02 100644 --- a/src/version.c +++ b/src/version.c @@ -252,7 +252,7 @@ static int included_patches[] = { //212, //211, //210, - //209, + 209, //208, 207, //206, |