Delete repeated functions (unset), instead of marking them as duplicates

This commit is contained in:
Sebastian Gniazdowski 2016-01-25 12:14:03 +01:00
parent 915e41c6d8
commit f105db9213

View file

@ -171,18 +171,20 @@ _zplugin-diff-functions() {
;;
diff)
typeset -A func
# This includes new functions
for i in "${(z)ZPLG_FUNCTIONS2[$uspl2]}"; do
func[$i]=1
done
# Remove duplicated entries, i.e. existing before
for i in "${(z)ZPLG_FUNCTIONS[$uspl2]}"; do
func[$i]=0
unset "func[$i]"
done
local answer="" key
for key in "${(k)func[@]}"; do
if [ "${func[$key]}" = "1" ]; then
answer+="$key"$'\n'
fi
answer+="$key"$'\n'
done
echo $ZPLG_COLORS[p]"Functions created:$reset_color"$'\n'"$answer"