diff options
-rw-r--r-- | gitstatus/gitstatus.plugin.zsh | 6 | ||||
-rwxr-xr-x | powerlevel9k.zsh-theme | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh index cc8f15e7..f5b48b71 100644 --- a/gitstatus/gitstatus.plugin.zsh +++ b/gitstatus/gitstatus.plugin.zsh @@ -119,7 +119,7 @@ function gitstatus_query() { (( OPTIND == ARGC )) || { echo "usage: gitstatus_query [OPTION]... NAME" >&2; return 1 } local name=${*[$OPTIND]} - [[ -v GITSTATUS_DAEMON_PID_${name} ]] + [[ -n ${(P)${:-GITSTATUS_DAEMON_PID_${name}}:-} ]] # Verify that gitstatus_query is running in the same process that ran gitstatus_start. local client_pid_var=_GITSTATUS_CLIENT_PID_${name} @@ -224,7 +224,7 @@ function gitstatus_start() { (( OPTIND == ARGC )) || { echo "usage: gitstatus_start [OPTION]... NAME" >&2; return 1 } local name=${*[$OPTIND]} - [[ ! -v GITSTATUS_DAEMON_PID_${name} ]] || return 0 + [[ -z ${(P)${:-GITSTATUS_DAEMON_PID_${name}}:-} ]] || return 0 local os && os=$(uname -s) && [[ -n $os ]] local arch && arch=$(uname -m) && [[ -n $arch ]] @@ -319,5 +319,5 @@ function gitstatus_start() { # If it returns non-zero, gitstatus_query NAME is guaranteed to return non-zero. function gitstatus_check() { local name=$1 - [[ -v GITSTATUS_DAEMON_PID_${name} ]] + [[ -n ${(P)${:-GITSTATUS_DAEMON_PID_${name}}:-} ]] } diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index ddc411a8..4b3af9ab 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -150,10 +150,11 @@ typeset -ga _P9K_RIGHT_JOIN=(1) _p9k_color() { local user_var=POWERLEVEL9K_${(U)${2}#prompt_}_${3} local color=${${(P)user_var}:-${1}} - # Check if given value is already numerical. - if [[ $color == <-> ]]; then + if [[ $color == <-> ]]; then # decimal color code: 255 _P9K_RETVAL=${(l:3::0:)color} - else + elif [[ $color == '#'* ]]; then # hexademical color code: #ffffff + _P9K_RETVAL=$color + else # named color: red # Strip prifixes if there are any. _P9K_RETVAL=$__P9K_COLORS[${${${color#bg-}#fg-}#br}] fi |