From: Felipe Contreras Date: Wed, 28 Oct 2020 02:06:58 +0000 (-0600) Subject: completion: zsh: simplify compadd functions X-Git-Tag: v2.30.0-rc0~105^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f459b0060948299be4bfa00c21f574140dcbe63;p=thirdparty%2Fgit.git completion: zsh: simplify compadd functions We don't need to override IFS, zsh has a native way of splitting by new lines: the expansion flag (f). Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index d9ce5e1742..1ef02f936c 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -100,9 +100,8 @@ __gitcomp_direct () { emulate -L zsh - local IFS=$'\n' compset -P '*[=:]' - compadd -Q -- ${${=1}% } && _ret=0 + compadd -Q -- ${${(f)1}% } && _ret=0 } __gitcomp_direct_append () @@ -114,34 +113,30 @@ __gitcomp_nl () { emulate -L zsh - local IFS=$'\n' compset -P '*[=:]' - compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 + compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0 } __gitcomp_nl_append () { emulate -L zsh - local IFS=$'\n' compset -P '*[=:]' - compadd -Q -S "${4- }" -p "${2-}" -- ${=1} && _ret=0 + compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0 } __gitcomp_file_direct () { emulate -L zsh - local IFS=$'\n' - compadd -f -- ${=1} && _ret=0 + compadd -f -- ${(f)1} && _ret=0 } __gitcomp_file () { emulate -L zsh - local IFS=$'\n' - compadd -p "${2-}" -f -- ${=1} && _ret=0 + compadd -p "${2-}" -f -- ${(f)1} && _ret=0 } __git_zsh_bash_func ()