diff --git a/history-search-multi-word.plugin.zsh b/history-search-multi-word.plugin.zsh index 6123236..bec42c2 100644 --- a/history-search-multi-word.plugin.zsh +++ b/history-search-multi-word.plugin.zsh @@ -4,6 +4,11 @@ # to ~/.zshrc. # +# This gives immunity to functionargzero being unset +# _ will be set to last argument to source builtin +PLUGIN_UNDERSCORE="$_" +[ "$0" != "$PLUGIN_UNDERSCORE" ] && 0="$PLUGIN_UNDERSCORE" + REPO_DIR="${0%/*}" if [[ -z "$ZPLG_CUR_PLUGIN" && "${fpath[(r)$REPO_DIR]}" != $REPO_DIR ]]; then fpath+=( "$REPO_DIR" )