Mercurial > vim
comparison src/ex_cmds.c @ 5728:bb402c49379d v7.4.209
updated for version 7.4.209
Problem: When repeating a filter command "%" and "#" are expanded.
Solution: Escape the command when storing for redo. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 19 Mar 2014 17:41:23 +0100 |
parents | b06e58f8dd30 |
children | 50dbef5e774a |
comparison
equal
deleted
inserted
replaced
5727:0c6baa50f3ce | 5728:bb402c49379d |
---|---|
1010 vim_free(prevcmd); | 1010 vim_free(prevcmd); |
1011 prevcmd = newcmd; | 1011 prevcmd = newcmd; |
1012 | 1012 |
1013 if (bangredo) /* put cmd in redo buffer for ! command */ | 1013 if (bangredo) /* put cmd in redo buffer for ! command */ |
1014 { | 1014 { |
1015 AppendToRedobuffLit(prevcmd, -1); | 1015 /* If % or # appears in the command, it must have been escaped. |
1016 * Reescape them, so that redoing them does not substitute them by the | |
1017 * buffername. */ | |
1018 char_u *cmd = vim_strsave_escaped(prevcmd, (char_u *)"%#"); | |
1019 | |
1020 if (cmd != NULL) | |
1021 { | |
1022 AppendToRedobuffLit(cmd, -1); | |
1023 vim_free(cmd); | |
1024 } | |
1025 else | |
1026 AppendToRedobuffLit(prevcmd, -1); | |
1016 AppendToRedobuff((char_u *)"\n"); | 1027 AppendToRedobuff((char_u *)"\n"); |
1017 bangredo = FALSE; | 1028 bangredo = FALSE; |
1018 } | 1029 } |
1019 /* | 1030 /* |
1020 * Add quotes around the command, for shells that need them. | 1031 * Add quotes around the command, for shells that need them. |