Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH v2] _compdef: Change and add sources for completed completion function names.
- X-seq: zsh-workers 43366
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH v2] _compdef: Change and add sources for completed completion function names.
- Date: Mon, 3 Sep 2018 13:44:36 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=fB0On7Ckh6qnFO3RMJroDnhZf0OTX/ai0aBDqN0fTGk=; b=bTYJa8Lq SddYxQWStiCg8aeHNy3hQb6N2WeH6HjoRkduxAyrcacs8UsxOIXrWwZQQLEgMO5d hZ93YIEVO/Zl5hNhGoYvK+eM+PaeQJXbVmIoZzQBrpgR0Lwp/ZPA6sYi4mZcpIuD 9yQj3P1culrsADAR7ScACJ42hz7YThViIgyIg3dEMEEwGhQaIlc1mL3PqcjxlKi4 Z8kztJDsOBw5dhLuv5OBWQ9cOECEcqlG8KHCsJlp6ONIjlWbc7yfvCP2QqZQBsKO oV7r4TMLtojwrW+ECzgdDuQO9tOKJK9asLZFxjYWXwIyC5WqCLsMwDaeOD+8y6C7 AlLPcLjbJKdy9g==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=fB0On7Ckh6qnFO3RMJroDnhZf0OTX/ai0aBDqN0fTGk=; b=UYCZWeFL WDrxrskDk0w2MTH7eDML8z7bjAXlphUVhh6A/ImrP8wbAXSzTAumDgF5YDjk3w2+ WQtV7L0y4mctf1RgjWL+tIweknwrbEpIrz9TCFLewm0V5DZQuWUPOFfsO0kgMkkr fZdzcBgCN6ksYNPacM00BMOXHs2bbDoy2TLHJoDkLbMD8UM8g32qicjJp8jfnYkD czngZxkZRsFpoBHmOSyS5Y4eBs1n+EAjnngFugnSXbQJBLU/jZvQym94ksPAb2i8 hS0YXOSVeXVVyqB3PldmgwyMiMa/sJglc3o6wNiX2FHvAyAnvD0nEnBiqvIq/LRx Lzu9A6nMgSqxBA==
- In-reply-to: <20180826105404.31846-1-danielsh@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180826105404.31846-1-danielsh@tarpaulin.shahaf.local2>
Use ${(v)_comps} instead of going through $fpath again. Use
${functions} as well to find more legitimate matches, such as various
__git_foo() helpers defined in ${^fpath}/_git.
---
Completion/Zsh/Command/_compdef | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Completion/Zsh/Command/_compdef b/Completion/Zsh/Command/_compdef
index 7a64da835..22af7f561 100644
--- a/Completion/Zsh/Command/_compdef
+++ b/Completion/Zsh/Command/_compdef
@@ -1,6 +1,6 @@
#compdef compdef
-local state line expl list disp curcontext="$curcontext" pat normal ret=1
+local state line expl disp curcontext="$curcontext" pat normal ret=1
local args1 args2
typeset -A opt_args
@@ -57,7 +57,8 @@ case $state in
_wanted commands expl 'completed command' compadd -k _comps && ret=0
;;
cfun)
- list=( ${^fpath:/.}/_(|*[^~])(:t) )
+ typeset -aU list=( ${(v)_comps} ${(k)functions[(I)_*]} )
+ (( ${+list[1]} )) || list+=( ${^fpath:/.}/_(|*[^~])(:t) )
if zstyle -T ":completion:${curcontext}:functions" prefix-hidden; then
disp=( ${list[@]#_} )
_wanted functions expl 'completion function' \
Messages sorted by:
Reverse Date,
Date,
Thread,
Author