Skip to content

Commit

Permalink
Use -first- instead of -default- when installing zsh global completer
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Dec 3, 2023
1 parent 50ee2c6 commit 95da435
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions argcomplete/bash_completion.d/_python-argcomplete
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ __python_argcomplete_which() {
}

_python_argcomplete_global() {

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

0 comments on commit 95da435

Please sign in to comment.