From 4e1bd9ebdf14cb1fb11e6a1ca9be1981c983ebd9 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 2 Dec 2021 21:01:28 +0100 Subject: 49630: allow zsh to quote matches from bash completions but include a special case for space suffixes --- Completion/bashcompinit | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/bashcompinit b/Completion/bashcompinit index b278ac8f4..adb659ca1 100644 --- a/Completion/bashcompinit +++ b/Completion/bashcompinit @@ -24,9 +24,10 @@ _bash_complete() { if [[ ${argv[${argv[(I)filenames]:-0}-1]} = -o ]]; then compset -P '*/' && matches=( ${matches##*/} ) compset -S '/*' && matches=( ${matches%%/*} ) - compadd -Q -f "${suf[@]}" -a matches && ret=0 + compadd -f "${suf[@]}" -a matches && ret=0 else - compadd -Q "${suf[@]}" -a matches && ret=0 + compadd "${suf[@]}" - "${(@)${(Q@)matches}:#*\ }" && ret=0 + compadd -S ' ' - ${${(M)${(Q)matches}:#*\ }% } && ret=0 fi fi -- cgit 1.4.1