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

allow individual segments to be hidden or shown with low latency

This commit is contained in:
romkatv 2019-10-27 18:18:15 +01:00
parent 6c8b24760c
commit d7f2667676

View file

@ -616,13 +616,14 @@ _p9k_left_prompt_segment() {
fi
p+="\${_p9k_c::=$content_exp_}"
p+='${_p9k_e::=${${__p9k_s_'${${1#prompt_}%%[A-Z_]#}'+00}:-'
if (( has_icon == -1 )); then
p+='${_p9k_e::=${${(%):-$_p9k_c%1(l.1.0)}[-1]}${${(%):-$_p9k_v%1(l.1.0)}[-1]}}'
p+='${${(%):-$_p9k_c%1(l.1.0)}[-1]}${${(%):-$_p9k_v%1(l.1.0)}[-1]}}'
else
p+='${_p9k_e::=${${(%):-$_p9k_c%1(l.1.0)}[-1]}'$has_icon'}'
p+='${${(%):-$_p9k_c%1(l.1.0)}[-1]}'$has_icon'}'
fi
p+='}+}'
p+='}}+}'
p+='${${_p9k_e:#00}:+${${_p9k_t[$_p9k_n]/'$ss'/$_p9k_ss}/'$s'/$_p9k_s}'
@ -795,7 +796,9 @@ _p9k_right_prompt_segment() {
local p=
p+="\${_p9k_n::=}"
p+="\${\${\${_p9k_bg:-0}:#NONE}:-\${_p9k_n::=$((t+1))}}" # 1
p+="\${_p9k_n:=\${\${\$(($join)):#0}:+$((t+2))}}" # 2
if [[ -n $join ]]; then
p+="\${_p9k_n:=\${\${\$(($join)):#0}:+$((t+2))}}" # 2
fi
if (( __p9k_sh_glob )); then
p+="\${_p9k_n:=\${\${(M)\${:-x\$_p9k_bg}:#x${(b)bg_color}}:+$((t+3))}}" # 3
p+="\${_p9k_n:=\${\${(M)\${:-x\$_p9k_bg}:#x${(b)bg_color:-0}}:+$((t+3))}}" # 3
@ -834,13 +837,14 @@ _p9k_right_prompt_segment() {
fi
p+="\${_p9k_c::=$content_exp_}"
p+='${_p9k_e::=${${__p9k_s_'${${1#prompt_}%%[A-Z_]#}'+00}:-'
if (( has_icon == -1 )); then
p+='${_p9k_e::=${${(%):-$_p9k_c%1(l.1.0)}[-1]}${${(%):-$_p9k_v%1(l.1.0)}[-1]}}'
p+='${${(%):-$_p9k_c%1(l.1.0)}[-1]}${${(%):-$_p9k_v%1(l.1.0)}[-1]}}'
else
p+='${_p9k_e::=${${(%):-$_p9k_c%1(l.1.0)}[-1]}'$has_icon'}'
p+='${${(%):-$_p9k_c%1(l.1.0)}[-1]}'$has_icon'}'
fi
p+='}+}'
p+='}}+}'
p+='${${_p9k_e:#00}:+${_p9k_t[$_p9k_n]/'$w'/$_p9k_w}'