mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
Improve get_icon_names function
As this function gets more and more important, it now checks for overrides the user has made and prints these icons instead. At least unless the first parameter is not set to "original". Then it will print the default icons.
This commit is contained in:
parent
e42cb50052
commit
f89104f68f
1 changed files with 12 additions and 1 deletions
|
@ -300,9 +300,20 @@ function print_icon() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Get a list of configured icons
|
||||||
|
# * $1 string - If "original", then the original icons are printed,
|
||||||
|
# otherwise "print_icon" is used, which takes the users
|
||||||
|
# overrides into account.
|
||||||
get_icon_names() {
|
get_icon_names() {
|
||||||
# Iterate over a ordered list of keys of the icons array
|
# Iterate over a ordered list of keys of the icons array
|
||||||
for key in ${(@kon)icons}; do
|
for key in ${(@kon)icons}; do
|
||||||
echo "POWERLEVEL9K_$key: ${icons[$key]}"
|
echo -n "POWERLEVEL9K_$key: "
|
||||||
|
if [[ "${1}" == "original" ]]; then
|
||||||
|
# print the original icons as they are defined in the array above
|
||||||
|
echo "${icons[$key]}"
|
||||||
|
else
|
||||||
|
# print the icons as they are configured by the user
|
||||||
|
echo "$(print_icon "$key")"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue