about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorAaron Schrab <aaron@schrab.com>2021-12-23 21:05:21 -0500
committerOliver Kiddle <opk@zsh.org>2021-12-29 00:29:50 +0100
commit92c80e72aa70ee4b3cc15271136f136e081a7ede (patch)
tree6589637e1452917fa3cc6ca1ca428f26951a7a55 /Completion
parent85bf9740a01e168b7b814469892d97fdabc67144 (diff)
downloadzsh-92c80e72aa70ee4b3cc15271136f136e081a7ede.tar.gz
zsh-92c80e72aa70ee4b3cc15271136f136e081a7ede.tar.xz
zsh-92c80e72aa70ee4b3cc15271136f136e081a7ede.zip
49664: Use associative array for third-party completion
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_git8
1 files changed, 4 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 04b5677ce..cecb80ac3 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6267,8 +6267,8 @@ _git_commands () {
   zstyle -a :completion:$curcontext: user-commands user_commands
 
   local command
-  for command in $_git_third_party_commands; do
-    (( $+commands[git-${command%%:*}] )) && third_party_commands+=$command
+  for command in ${(k)_git_third_party_commands}; do
+    (( $+commands[git-${command}] )) && third_party_commands+=$command$_git_third_party_commands[$command]
   done
 
   local -a aliases
@@ -8475,7 +8475,7 @@ _git() {
 }
 
 # Load any _git-* definitions so that they may be completed as commands.
-declare -gUa _git_third_party_commands
+declare -gA _git_third_party_commands
 _git_third_party_commands=()
 
 local file input
@@ -8497,7 +8497,7 @@ for file in ${^fpath}/_git-*~(*~|*.zwc)(-.N); do
     (( i++ ))
   done < $file
 
-  _git_third_party_commands+=$name$desc
+  _git_third_party_commands+=([$name]=$desc)
 done
 
 _git