From fa441fa20e6d7d93e613f339d0c67ba8b0ab09c4 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Tue, 8 May 2018 17:13:12 +0100
Subject: 42752: enhance git external alias completion
If alias expands to !cmd-name, complete as a normal command
line after cmd-name.
---
Completion/Unix/Command/_git | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'Completion/Unix/Command/_git')
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index f6cec8b60..21ba65724 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -7758,7 +7758,10 @@ _git() {
curcontext=${curcontext%:*:*}:git-$words[1]:
(( $+opt_args[--git-dir] )) && local -x GIT_DIR=$opt_args[--git-dir]
if ! _call_function ret _git-$words[1]; then
- if zstyle -T :completion:$curcontext: use-fallback; then
+ if [[ $words[1] = \!* ]]; then
+ words[1]=${words[1]##\!}
+ _normal && ret=0
+ elif zstyle -T :completion:$curcontext: use-fallback; then
_default && ret=0
else
_message "unknown sub-command: $words[1]"
--
cgit 1.4.1