Much more clean and performance-wise array declaration respecting the POSIX syntax in zsh's `powermeli` theme

master
Meliurwen 3 years ago
parent 8cf9cc6b6b
commit d4f2ccac23
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 6
      zsh/.config/zsh/plugins/powermeli.zsh-theme

@ -53,9 +53,9 @@ prompt_git() {
git_str="" git_str=""
if [ -n "$git_status" ]; then if [ -n "$git_status" ]; then
prompt_segment "$SEGMENT_SEPARATOR" yellow black prompt_segment "$SEGMENT_SEPARATOR" yellow black
# Using `emulate` here is ugly as hell, but necessary to not get syntax # If sourced or executed by zsh overwrite with an associative array
# error from `sh/dash`. Hope it doesn't costs too much in performances. # https://zsh.sourceforge.io/Doc/Release/Parameters.html#Array-Parameters
[ -z ${ZSH_VERSION+x} ] && emulate zsh -c 'git_status=( ${(f)"${git_Status}"} )' [ -z ${ZSH_VERSION+x} ] && set -A git_status ${(f)"${git_status}"}
OLDIFS="$IFS" OLDIFS="$IFS"
IFS=" IFS="
" "

Loading…
Cancel
Save