From 1f09b2909dd21ecb58a67125f340466da50e92b0 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 18 Apr 2009 07:26:56 +0000 Subject: users/14033 as modified by users/14037 and added doc: allow colon quoting in matches in _describe --- ChangeLog | 8 +++++++- Completion/Base/Utility/_describe | 4 ++-- Doc/Zsh/compsys.yo | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57ef61510..ad115dcde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-18 Andrey Borzenkov + + * users/14033 as modified by users/14037 and added doc: + Completion/Base/Utility/_describe, Doc/Zsh/compsys.yo: allow + quoting of ":" with backslashes in possible matches in _describe + 2009-04-17 Peter Stephenson * users/14041: Doc/Zsh/zle.yo, Src/Zle/zle_bindings.c: bind ":" @@ -11567,5 +11573,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.4655 $ +* $Revision: 1.4656 $ ***************************************************** diff --git a/Completion/Base/Utility/_describe b/Completion/Base/Utility/_describe index d5d7aeba7..f899b0ad0 100644 --- a/Completion/Base/Utility/_describe +++ b/Completion/Base/Utility/_describe @@ -97,10 +97,10 @@ while _tags; do if [[ -n $_mats ]]; then compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \ - "${(@M)${(@P)_mats}##([^:\\]|\\?)##}" + "${(@)${(@M)${(@P)_mats}##([^:\\]|\\?)##}//\\(#b)(?)/$match[1]}" else compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \ - "${(@M)${(@P)_strs}##([^:\\]|\\?)##}" + "${(@)${(@M)${(@P)_strs}##([^:\\]|\\?)##}//\\(#b)(?)/$match[1]}" fi done set - "$_argv[@]" diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index f7e47b1e1..e4272b654 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4016,7 +4016,8 @@ The var(descr) is taken as a string to display above the matches if the tt(format) style for the tt(descriptions) tag is set. This is followed by one or two names of arrays followed by options to pass to tt(compadd). The first array contains the possible completions with their descriptions in -the form `var(completion)tt(:)var(description)'. If a second array is +the form `var(completion)tt(:)var(description)'. Any literal colons in +var(completion) must be quoted with a backslash. If a second array is given, it should have the same number of elements as the first; in this case the corresponding elements are added as possible completions instead of the var(completion) strings from the first array. The completion list -- cgit 1.4.1