From 2f67cd514fef304ac40d49e5bb9c40bcee31664a Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 18 Jun 2016 00:15:11 +0200 Subject: 38707: strip suffix for glob qualifier completion --- Completion/Unix/Type/_files | 1 + Completion/Unix/Type/_path_files | 1 + Completion/Zsh/Type/_globquals | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'Completion') diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files index fe0780a57..69878242f 100644 --- a/Completion/Unix/Type/_files +++ b/Completion/Unix/Type/_files @@ -7,6 +7,7 @@ local ret=1 # we don't want to complete them multiple times (for each file pattern). if _have_glob_qual $PREFIX; then compset -p ${#match[1]} + compset -S '[^\)\|\~]#(|\))' if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then _globflags && ret=0 else diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files index 14c4cc753..6a1e89f05 100644 --- a/Completion/Unix/Type/_path_files +++ b/Completion/Unix/Type/_path_files @@ -17,6 +17,7 @@ local -a match mbegin mend if _have_glob_qual $PREFIX; then local ret=1 compset -p ${#match[1]} + compset -S '[^\)\|\~]#(|\))' if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then _globflags && ret=0 else diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals index 2523eb333..ed9c008a1 100644 --- a/Completion/Zsh/Type/_globquals +++ b/Completion/Zsh/Type/_globquals @@ -125,7 +125,7 @@ while [[ -n $PREFIX ]]; do alts+=("senses:sense:compadd -E 0 -d sdisp -S '' - + '' -") fi specmap=( M months w weeks h hours m minutes s seconds '(|+|-|d)' days) - alts+=('digits:digit ('${${specmap[(K)$timespec]}:-invalid time specifier}'):_dates -f ${${timespec/[-+]/d}:-d} -S ""' ) + alts+=('digits:digit ('${${specmap[(K)${timespec:-d}]}:-invalid time specifier}'):_dates -f ${${timespec/[-+]/d}:-d} -S ""' ) _alternative $alts return fi -- cgit 1.4.1