diff options
author | Prajjwal Singh <sin@prajjwal.com> | 2019-09-08 19:46:00 +0530 |
---|---|---|
committer | Marc Cornellà <marc.cornella@live.com> | 2019-09-08 16:16:00 +0200 |
commit | 229a1c971903aaae0bebf73dfda41cb71c25560c (patch) | |
tree | c85c6e767c1a55cc860b1b0c99f58cadb4842d9c /plugins/gitfast/_git | |
parent | 101ea872326211830e90d2bd01bd8506673f9d11 (diff) | |
download | zsh-229a1c971903aaae0bebf73dfda41cb71c25560c.tar.gz zsh-229a1c971903aaae0bebf73dfda41cb71c25560c.tar.bz2 zsh-229a1c971903aaae0bebf73dfda41cb71c25560c.zip |
gitfast: update completions (#8130)
Includes completions for `git switch`.
Diffstat (limited to 'plugins/gitfast/_git')
-rw-r--r-- | plugins/gitfast/_git | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index 78a6dbb3d..886bf95d1 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -30,7 +30,7 @@ if [ -z "$script" ]; then local -a locations local e locations=( - "$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash" + $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash '/etc/bash_completion.d/git' # fedora, old debian '/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian '/usr/share/bash-completion/git' # gentoo @@ -39,7 +39,7 @@ if [ -z "$script" ]; then test -f $e && script="$e" && break done fi -ZSH_VERSION='' . "$script" +GIT_SOURCING_ZSH_COMPLETION=y . "$script" __gitcomp () { @@ -93,13 +93,22 @@ __gitcomp_nl_append () compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 } +__gitcomp_file_direct () +{ + emulate -L zsh + + local IFS=$'\n' + compset -P '*[=:]' + compadd -f -- ${=1} && _ret=0 +} + __gitcomp_file () { emulate -L zsh local IFS=$'\n' compset -P '*[=:]' - compadd -Q -p "${2-}" -f -- ${=1} && _ret=0 + compadd -p "${2-}" -f -- ${=1} && _ret=0 } __git_zsh_bash_func () @@ -223,10 +232,8 @@ _git () if (( $+functions[__${service}_zsh_main] )); then __${service}_zsh_main - elif (( $+functions[__${service}_main] )); then + else emulate ksh -c __${service}_main - elif (( $+functions[_${service}] )); then - emulate ksh -c _${service} fi let _ret && _default && _ret=0 |