From 8655867ca2b32a9c0755a18e4c2d4b161cc10c76 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Fri, 13 Apr 2018 15:13:43 -0500 Subject: [PATCH] [git] Add completion for gbx and gbX that use the git-branch-delete-interactive function. Thanks to @Mikachu for helping with the completion function implementation over the #zsh chat. Closes #265 --- modules/git/functions/_git-branch-delete-interactive | 3 +++ modules/git/functions/git-branch-delete-interactive | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 modules/git/functions/_git-branch-delete-interactive diff --git a/modules/git/functions/_git-branch-delete-interactive b/modules/git/functions/_git-branch-delete-interactive new file mode 100644 index 0000000..e102f80 --- /dev/null +++ b/modules/git/functions/_git-branch-delete-interactive @@ -0,0 +1,3 @@ +#compdef git-branch-delete-interactive + +words[1]=(git branch); (( CURRENT++ )); service=git; _git diff --git a/modules/git/functions/git-branch-delete-interactive b/modules/git/functions/git-branch-delete-interactive index 9a7f6a3..2eb0985 100644 --- a/modules/git/functions/git-branch-delete-interactive +++ b/modules/git/functions/git-branch-delete-interactive @@ -1,6 +1,6 @@ # vim:et sts=2 sw=2 ft=zsh local -a remotes -if (( ${*[(I)-r]} || ${*[(I)--remotes]} )); then +if (( ${*[(I)(-r|--remotes)]} )); then remotes=(${^*:#-*}) else remotes=(${(f)"$(command git rev-parse --abbrev-ref ${^*:#-*}@{u} 2>/dev/null)"})