From: Daniel Carl Date: Tue, 3 Jun 2014 18:20:24 +0000 (+0200) Subject: Allow to escape % with \ in expanded commands. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=58685d1f3a085511b82a5d90dd966eeacd339353;p=vimb.git Allow to escape % with \ in expanded commands. --- diff --git a/doc/vimb.1 b/doc/vimb.1 index 8fb6bbe..d3ecb3c 100644 --- a/doc/vimb.1 +++ b/doc/vimb.1 @@ -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 diff --git a/src/ex.c b/src/ex.c index 4ec27bc..8ad0096 100644 --- 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 {