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:
commit
cef8c65586
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue