From d259e19dd8d8bca9810699de4a351dd66aade00e Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 19 Nov 2018 19:43:21 -0500 Subject: [PATCH] Don't need to use `array[@]` ouside double quotes In double quotes, array elements are put into separate words when using `"${(@)array}"` or `"${array[@]}"`. See zshexpn(1). Also according to the Zsh documentation, these forms preserve empty elements of the array. --- modules/git/functions/git-branch-delete-interactive | 2 +- modules/pacman/init.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/git/functions/git-branch-delete-interactive b/modules/git/functions/git-branch-delete-interactive index 5886cfe..f6e7310 100644 --- a/modules/git/functions/git-branch-delete-interactive +++ b/modules/git/functions/git-branch-delete-interactive @@ -6,7 +6,7 @@ else remotes=(${(f)"$(command git rev-parse --abbrev-ref ${^*:#-*}@{u} 2>/dev/null)"}) || remotes=() fi if command git branch --delete ${@} && \ - (( ${#remotes[@]} )) && \ + (( ${#remotes} )) && \ read -q "?Also delete remote branch(es) ${remotes} [y/N]? "; then print local remote diff --git a/modules/pacman/init.zsh b/modules/pacman/init.zsh index 7449f7b..397ae45 100644 --- a/modules/pacman/init.zsh +++ b/modules/pacman/init.zsh @@ -126,7 +126,7 @@ alias pacblame="${zpacman_frontend} -Qo" # # source helper functions/aliases -for helper in ${zpacman_helper[@]}; do +for helper in ${zpacman_helper}; do if [[ -s ${0:h}/helper_${helper}.zsh ]]; then source ${0:h}/helper_${helper}.zsh else