Skip to content

Commit

Permalink
feat: Powerlevel9k#1252 - Disable segment on flag
Browse files Browse the repository at this point in the history
Add generic mechanism to disable segment when flag $POWERLEVEL9K_segmend_DISABLED is set to "1"
  • Loading branch information
grzesuav committed Sep 1, 2019
1 parent 3dafd79 commit f2d1cd8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,10 @@ build_left_prompt() {
for element in "${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[@]}"; do
# Remove joined information in direct calls
element=${element%_joined}

disabled_flag="POWERLEVEL9K_$element:u_DISABLED"
if [[ "${(P)disabled_flag}" == "1" ]]; then
continue;
fi
# Check if it is a custom command, otherwise interpet it as
# a prompt.
if [[ $element[0,7] =~ "custom_" ]]; then
Expand All @@ -1779,7 +1782,10 @@ build_right_prompt() {
for element in "${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[@]}"; do
# Remove joined information in direct calls
element=${element%_joined}

disabled_flag="POWERLEVEL9K_$element:u_DISABLED"
if [[ "${(P)disabled_flag}" == "1" ]]; then
continue;
fi
# Check if it is a custom command, otherwise interpet it as
# a prompt.
if [[ $element[0,7] =~ "custom_" ]]; then
Expand Down

0 comments on commit f2d1cd8

Please sign in to comment.