X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fkeephack;h=8accae0469e54cdd55613307db2c58baadb64b88;hb=430b9c2ab968caeadd979644e99c3f7b3d91a654;hp=d4c8a5f0e5a54d514d5125a7273624f5b9e02955;hpb=8bdf3e57fdc82885826b23f7cd8c905b6331feb5;p=grml-etc-core.git diff --git a/etc/zsh/keephack b/etc/zsh/keephack index d4c8a5f..8accae0 100644 --- a/etc/zsh/keephack +++ b/etc/zsh/keephack @@ -13,7 +13,7 @@ setopt localoptions nomarkdirs nonomatch nocshnullglob nullglob kept=() # Erase old value in case of error on next line kept=($~*) - if [[ ! -t 0 ]]; then + if [[ ! -t 0 ]] ; then local line while read line; do kept+=( $line ) # += is a zsh 4.2+ feature @@ -37,14 +37,15 @@ (( $#kept )) || return 1 local action zstyle -s :completion:$curcontext insert-kept action - if [[ -n $action ]] - then compstate[insert]=$action - elif [[ $WIDGET = *expand* ]] - then compstate[insert]=all + if [[ -n $action ]] ; then + compstate[insert]=$action + elif [[ $WIDGET == *expand* ]] ; then + compstate[insert]=all fi - if [[ $WIDGET = *expand* ]] - then compadd -U ${(M)kept:#${~words[CURRENT]}} - else compadd -a kept + if [[ $WIDGET == *expand* ]] ; then + compadd -U ${(M)kept:#${~words[CURRENT]}} + else + compadd -a kept fi } @@ -62,8 +63,7 @@ function compadd() { local -A args zparseopts -E -A args J: - if [[ $args[-J] == all-expansions ]] - then + if [[ $args[-J] == all-expansions ]] ; then builtin compadd -A kept "$@" kept=( ${(Q)${(z)kept}} ) fi