Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Make check for segments in use take joined segments into account
Browse files Browse the repository at this point in the history
  • Loading branch information
dritter committed Mar 29, 2019
1 parent 690af68 commit 1015b38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions functions/utilities.zsh
Expand Up @@ -202,11 +202,10 @@ fi
# * $1: The segment to be tested.
segment_in_use() {
local key=$1
if [[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)$key]}" ]] || [[ -n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)$key]}" ]]; then
return 0
else
return 1
fi
[[ -n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)${key}]}" ||
-n "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[(r)${key}_joined]}" ||

This comment has been minimized.

Copy link
@romkatv

romkatv Apr 4, 2019

Formatting nit: Seems like you've got some tabs in here and spaces above.

-n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)${key}]}" ||
-n "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[(r)${key}_joined]}" ]]
}
# Print a deprecation warning if an old segment is in use.
Expand Down
2 changes: 1 addition & 1 deletion powerlevel9k.zsh-theme
Expand Up @@ -1910,7 +1910,7 @@ prompt_powerlevel9k_setup() {
# initialize colors
autoload -U colors && colors

if segment_in_use "vcs" || segment_in_use "vcs_joined"; then
if segment_in_use "vcs"; then
powerlevel9k_vcs_init
fi

Expand Down

0 comments on commit 1015b38

Please sign in to comment.