Permalink
Browse files

don't overwrite existing completion definitions in gnucompletions plugin

  • Loading branch information...
1 parent c469cdb commit ebd2d63cd5f9e6de60b0435d38eb63d5c3fdf602 @rsanders committed Feb 11, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 zsh/plugins/gnucompletions/{zshrc.zsh → zcomp.zsh}
@@ -1,7 +1,7 @@
#
function() {
- typeset -a gnucmds
+ typeset -a gnucmds tempcommands
typeset -a -g GNU_GENERIC_COMMANDS
if [[ $dotto_vars[os] -eq "Darwin" ]]; then
@@ -10,7 +10,8 @@ function() {
gnucmds+=( pkgutil dtrace otool )
# various system dtrace scripts
- gnucmds+=( /usr/bin/*.d(.x) )
+ tempcommands=( /usr/bin/*.d(.x) )
+ gnucmds+=( ${tempcommands:t} )
elif [[ $dotto_vars[os] -eq "Linux" ]]; then
gnucmds+=( ls cat )
fi
@@ -39,6 +40,6 @@ function() {
local cmd
for cmd in $gnucmds; do
- compdef _gnu_generic $cmd
+ [[ -z $_comps[$cmd] ]] && compdef _gnu_generic $cmd
done
}

0 comments on commit ebd2d63

Please sign in to comment.