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

[Enhancement] feat: #1252 - Disable segment on flag #1359

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions generator/default.p9k
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ function __p9k_build_left_prompt() {

# Remove joined information in direct calls
element="${element%_joined}"

disabled_flag="P9K_$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 Expand Up @@ -342,7 +345,10 @@ function __p9k_build_right_prompt() {

# Remove joined information in direct calls
element="${element%_joined}"

disabled_flag="P9K_$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
"__p9k_prompt_custom" "right" "$index" ${joined} $element[8,-1]
Expand Down