Merge pull request #449 from dritter/ordered_icons_list

Sort the output of `get_icon_names` alphabetically
pull/22/head
Ben Hilburn 8 years ago committed by GitHub
commit 33b41ced80

@ -307,8 +307,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() {
for key in ${(@k)icons}; do # Iterate over a ordered list of keys of the icons array
echo "POWERLEVEL9K_$key: ${icons[$key]}" 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 done
} }

Loading…
Cancel
Save