1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 21:51:40 +02:00

42752: enhance git external alias completion

If alias expands to !cmd-name, complete as a normal command
line after cmd-name.
This commit is contained in:
Peter Stephenson 2018-05-08 17:13:12 +01:00
parent c8ceb66ba3
commit fa441fa20e
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2018-05-08 Peter Stephenson <p.stephenson@samsung.com> 2018-05-08 Peter Stephenson <p.stephenson@samsung.com>
* 42752: Completion/Unx/Command/_git: better completion
handling for git aliases expanding to external command.
* 42751: Src/Zle/zle_main.c: Protect shell status around * 42751: Src/Zle/zle_main.c: Protect shell status around
time function execution in line editor. time function execution in line editor.

View file

@ -7758,7 +7758,10 @@ _git() {
curcontext=${curcontext%:*:*}:git-$words[1]: curcontext=${curcontext%:*:*}:git-$words[1]:
(( $+opt_args[--git-dir] )) && local -x GIT_DIR=$opt_args[--git-dir] (( $+opt_args[--git-dir] )) && local -x GIT_DIR=$opt_args[--git-dir]
if ! _call_function ret _git-$words[1]; then 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 _default && ret=0
else else
_message "unknown sub-command: $words[1]" _message "unknown sub-command: $words[1]"