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

Merge pull request #268 from mateusmedeiros/hide-custom-segment-when-empty

Make prompt_custom not print the segment if empty
This commit is contained in:
Ben Hilburn 2016-05-27 11:55:04 -04:00
commit cef8c65586

View file

@ -444,8 +444,11 @@ prompt_context() {
# the output in a segment. # the output in a segment.
prompt_custom() { prompt_custom() {
local command=POWERLEVEL9K_CUSTOM_$3:u local command=POWERLEVEL9K_CUSTOM_$3:u
local segment_content="$(eval ${(P)command})"
"$1_prompt_segment" "${0}_${3:u}" "$2" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$(eval ${(P)command})" if [[ -n $segment_content ]]; then
"$1_prompt_segment" "${0}_${3:u}" "$2" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$segment_content"
fi
} }
# Dir: current working directory # Dir: current working directory