mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-17 18:20:07 +00:00
Merge pull request #449 from dritter/ordered_icons_list
Sort the output of `get_icon_names` alphabetically
This commit is contained in:
commit
33b41ced80
1 changed files with 14 additions and 2 deletions
|
@ -307,8 +307,20 @@ function print_icon() {
|
|||
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() {
|
||||
for key in ${(@k)icons}; do
|
||||
echo "POWERLEVEL9K_$key: ${icons[$key]}"
|
||||
# Iterate over a ordered list of keys of the icons array
|
||||
for key in ${(@kon)icons}; do
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue