1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-17 18:20:07 +00:00

Add toggle for showing OK in non verbose status

Adds the toggle POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE for more
customizability. If POWERLEVEL9K_STATUS_VERBOSE is false and
POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE is true, the status prompt will
show the OK visual identifier like in verbose mode. The prompt will show
the OK identifier even if POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE is false
in verbose mode.
This commit is contained in:
Arav Singhal 2016-10-27 11:42:21 +05:30
parent 9b7fffe1a8
commit cde591ce2e

View file

@ -739,6 +739,7 @@ prompt_rvm() {
# Status: return code if verbose, otherwise just an icon if an error occurred # Status: return code if verbose, otherwise just an icon if an error occurred
set_default POWERLEVEL9K_STATUS_VERBOSE true set_default POWERLEVEL9K_STATUS_VERBOSE true
set_default POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE false
prompt_status() { prompt_status() {
if [[ "$RETVAL" -ne 0 ]]; then if [[ "$RETVAL" -ne 0 ]]; then
if [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then if [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then
@ -746,7 +747,7 @@ prompt_status() {
else else
"$1_prompt_segment" "$0_ERROR" "$2" "$DEFAULT_COLOR" "red" "" 'FAIL_ICON' "$1_prompt_segment" "$0_ERROR" "$2" "$DEFAULT_COLOR" "red" "" 'FAIL_ICON'
fi fi
else elif [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true || "$POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE" == true ]]; then
"$1_prompt_segment" "$0_OK" "$2" "$DEFAULT_COLOR" "046" "" 'OK_ICON' "$1_prompt_segment" "$0_OK" "$2" "$DEFAULT_COLOR" "046" "" 'OK_ICON'
fi fi
} }