mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-08-22 18:41:00 +02:00
43366: _compdef: Change and add sources for completed completion function names.
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.
This commit is contained in:
parent
f7e874c101
commit
b39a102262
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2018-09-06 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||
|
||||
* 43366: Completion/Zsh/Command/_compdef: Change and add sources
|
||||
for completed completion function names.
|
||||
|
||||
2018-09-05 dana <dana@dana.is>
|
||||
|
||||
* 43372: Completion/Linux/Command/_e2label: Add completion for
|
||||
|
|
|
@ -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' \
|
||||
|
|
Loading…
Reference in a new issue