Skip to content

Commit 95da435

Browse files
committed
Use -first- instead of -default- when installing zsh global completer
1 parent 50ee2c6 commit 95da435

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

argcomplete/bash_completion.d/_python-argcomplete

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ __python_argcomplete_which() {
115115
}
116116

117117
_python_argcomplete_global() {
118-
119118
if [[ -n "${ZSH_VERSION-}" ]]; then
120119
# Store result of a regex match in the
121120
# BASH_REMATCH variable rather than MATCH
@@ -237,8 +236,8 @@ if [[ -z "${ZSH_VERSION-}" ]]; then
237236
complete -o default -o bashdefault -D -F _python_argcomplete_global
238237
else
239238
autoload is-at-least
240-
# Replace only the default completer (_default).
241-
# There are many other special contexts we don't want to override.
239+
# Set a hook for argcomplete to be called first if no other completers are defined for the given command.
240+
# "compdef _python_argcomplete_global -P *" overrides other special contexts that we want to preserve:
242241
# https://zsh.sourceforge.io/Doc/Release/Completion-System.html
243-
compdef _python_argcomplete_global -default-
242+
compdef _python_argcomplete_global -first-
244243
fi

0 commit comments

Comments
 (0)