aboutsummaryrefslogtreecommitdiffstats
path: root/misc/completion/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'misc/completion/zsh')
-rw-r--r--misc/completion/zsh/git-bug11
1 files changed, 9 insertions, 2 deletions
diff --git a/misc/completion/zsh/git-bug b/misc/completion/zsh/git-bug
index 3ddfddb8..5da05031 100644
--- a/misc/completion/zsh/git-bug
+++ b/misc/completion/zsh/git-bug
@@ -1,4 +1,5 @@
#compdef git-bug
+compdef _git-bug git-bug
# zsh completion for git-bug -*- shell-script -*-
@@ -17,8 +18,9 @@ _git-bug()
local shellCompDirectiveNoFileComp=4
local shellCompDirectiveFilterFileExt=8
local shellCompDirectiveFilterDirs=16
+ local shellCompDirectiveKeepOrder=32
- local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace
+ local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace keepOrder
local -a completions
__git-bug_debug "\n========= starting completion logic =========="
@@ -136,6 +138,11 @@ _git-bug()
noSpace="-S ''"
fi
+ if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
+ __git-bug_debug "Activating keep order."
+ keepOrder="-V"
+ fi
+
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
# File extension filtering
local filteringCmd
@@ -171,7 +178,7 @@ _git-bug()
return $result
else
__git-bug_debug "Calling _describe"
- if eval _describe "completions" completions $flagPrefix $noSpace; then
+ if eval _describe $keepOrder "completions" completions $flagPrefix $noSpace; then
__git-bug_debug "_describe found some completions"
# Return the success of having called _describe