completion: zsh: fix __gitcomp_direct()
Many callers append a space suffix, but zsh automatically appends a space, making the completion add two spaces, for example: git log ma<tab> Will complete 'master '. Let's remove that extra space. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras committed
Oct 24, 2020 at 22:13 UTC
4ce2b5167bb63e7001e43ec5386528fb77c088fa
2 files changed
+2
-2
contrib/completion/git-completion.bash
+1
-1
@@ -3498,7 +3498,7 @@ if [[ -n ${ZSH_VERSION-} ]] &&
3498
3499
local IFS=$'\n'
3500
compset -P '*[=:]'
3501
- compadd -Q -- ${=1} && _ret=0
3501
+ compadd -Q -- ${${=1}% } && _ret=0
3502
}
3503
3504
__gitcomp_nl ()
contrib/completion/git-completion.zsh
+1
-1
@@ -74,7 +74,7 @@ __gitcomp_direct ()
74
75
local IFS=$'\n'
76
compset -P '*[=:]'
77
- compadd -Q -- ${=1} && _ret=0
77
+ compadd -Q -- ${${=1}% } && _ret=0
78
}
79
80
__gitcomp_nl ()