Allow to escape % with \ in expanded commands.
authorDaniel Carl <danielcarl@gmx.de>
Tue, 3 Jun 2014 18:20:24 +0000 (20:20 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Tue, 3 Jun 2014 18:27:34 +0000 (20:27 +0200)
doc/vimb.1
src/ex.c

index 8fb6bbe..d3ecb3c 100644 (file)
@@ -537,7 +537,8 @@ Removes all entries from queue.
 .BI ":sh[ellcmd] " CMD
 Runs given shell \fICMD\fP syncron and print the output into inputbox. The
 \fICMD\fP can contain multiple '%' chars that are expanded to the current
-opened URI. Also the '~/' to home dir expansion is available.
+opened URI to input a % this has to be escaped by a '\'. Also the '~/' to home
+dir expansion is available.
 .TP
 .BI ":sh[ellcmd]! " CMD
 Runs given shell \fICMD\fP asyncron. The '%' and '~/' expanshion of the :sh
index 4ec27bc..8ad0096 100644 (file)
--- a/src/ex.c
+++ b/src/ex.c
@@ -660,7 +660,7 @@ static gboolean parse_rhs(const char **input, ExArg *arg)
             if (!*input) {
                 /* if input ends here - use only the backslash */
                 g_string_append_c(arg->rhs, quote);
-            } else if (**input == '|') {
+            } else if (**input == '|' || **input == '%') {
                 /* escaped char becomes only char */
                 g_string_append_c(arg->rhs, **input);
             } else {