It's useful to specify specific suffixes for specific words.
This will be useful later on.
Signed-off-by: Felipe Contreras <redacted>
---
contrib/completion/git-completion.zsh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index 3818291950..a4b5e7dcc4 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -67,11 +67,10 @@ __gitcomp_opts ()
[[ "$cur_" == *= ]] && return
local c IFS=$' \t\n' sfx
- local -a array
for c in ${=1}; do
if [[ $c == "--" ]]; then
[[ "$cur_" == --no-* ]] && continue
- array+=("--no-... ")
+ compadd -S " " -- "--no-..." && _ret=0
break
fi
@@ -83,9 +82,8 @@ __gitcomp_opts ()
else
sfx="$4"
fi
- array+=("$c$sfx")
+ compadd -S "$sfx" -p "${2-}" -- "$c" && _ret=0
done
- compadd -S '' -p "${2-}" -a -- array && _ret=0
}
__gitcomp_nl ()--
2.32.0