diff --git a/build/build.plugin.zsh b/build/build.plugin.zsh index 688d0b6..d45d3a2 100644 --- a/build/build.plugin.zsh +++ b/build/build.plugin.zsh @@ -8,7 +8,16 @@ alias build="build-dir --build" # command line arguments. if [ `uname` = Linux ]; then if [[ "`vim --version`" =~ "^VIM - Vi IMproved 8\.1.*$" ]]; then - function vimdebug() { vim "+packadd termdebug" "+TermdebugCommand $*" } + autoload -U regexp-replace + function vimdebug() { + # For each item in $* replace * and \* and then replace \ with \\ + local args=() + for arg in "$@"; do + regexp-replace arg '\*' '\\*' + args+=($arg) + done + vim "+packadd termdebug" "+TermdebugCommand $args" + } alias debug='vimdebug' elif which cgdb &> /dev/null; then alias debug='cgdb --args' @@ -165,11 +174,11 @@ EOF # Build then run a target residing in `~build/bin`. build-run() { local target=$1; shift 1 - eval build $target && ~build/bin/$target $* + eval build $target && ~build/bin/$target "$@" } # Build then debug a target residing in `~build/bin`. build-debug() { local target=$1; shift 1 - eval build $target && debug ~build/bin/$target $* + eval build $target && debug ~build/bin/$target "$@" }