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

Merge branch 'raul-benito-master'

This commit is contained in:
romkatv 2019-07-01 19:09:10 +02:00
commit 9b818960c2

View file

@ -42,6 +42,16 @@ typeset -gi _P9K_I
typeset -g _P9K_BG typeset -g _P9K_BG
typeset -g _P9K_F typeset -g _P9K_F
typeset -gA ICON_ASSOC=(
"/etc|/etc/*" ETC_ICON
"${HOME}" HOME_ICON
"${HOME}/*" HOME_SUB_ICON
)
typeset -gA STATE_ASSOC=(
"/etc|/etc/*" ETC
"${HOME}" HOME
"${HOME}/*" HOME_SUBFOLDER
)
# Specifies the maximum number of elements in the cache. When the cache grows over this limit, # Specifies the maximum number of elements in the cache. When the cache grows over this limit,
# it gets cleared. This is meant to avoid memory leaks when a rogue prompt is filling the cache # it gets cleared. This is meant to avoid memory leaks when a rogue prompt is filling the cache
# with data. # with data.
@ -868,14 +878,9 @@ prompt_dir() {
state=NOT_WRITABLE state=NOT_WRITABLE
icon=LOCK_ICON icon=LOCK_ICON
else else
case $PWD in icon=${ICON_ASSOC[(k)$PWD]:-DEFAULT}
/etc|/etc/*) state=ETC; icon=ETC_ICON;; state=${STATE_ASSOC[(k)$PWD]:-DEFAULT}
~) state=HOME; icon=HOME_ICON;;
~/*) state=HOME_SUBFOLDER; icon=HOME_SUB_ICON;;
*) state=DEFAULT; icon=FOLDER_ICON;;
esac
fi fi
local style=%b local style=%b
_p9k_color blue $0_$state BACKGROUND _p9k_color blue $0_$state BACKGROUND
_p9k_background $_P9K_RETVAL _p9k_background $_P9K_RETVAL