From 082f703ccdfd77fa5301023b3031c873143cdbf3 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 12 Nov 2018 10:34:32 +0100 Subject: 43818: complete math functions for other modules besides zsh/mathfunc --- Completion/Zsh/Type/_module_math_func | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Completion/Zsh') diff --git a/Completion/Zsh/Type/_module_math_func b/Completion/Zsh/Type/_module_math_func index 6be9c006a..5044bdf4c 100644 --- a/Completion/Zsh/Type/_module_math_func +++ b/Completion/Zsh/Type/_module_math_func @@ -1,9 +1,12 @@ #autoload -local expl -local -a funcs +local mod +local -a funcs alts +local -a modules=( example mathfunc system ) -funcs=(${${${(f)"$(zmodload -Fl zsh/mathfunc 2>/dev/null)"}:#^+f:*}##+f:}) +for mod in $modules; do + funcs=( ${${${(f)"$(zmodload -Fl zsh/$mod 2>/dev/null)"}:#^+f:*}##+f:} ) + alts+=( "module-math-functions.${mod}:math function from zsh/${mod}:compadd -S '(' $funcs" ) +done -_wanted module-math-functions expl 'math function from zsh/mathfunc' \ - compadd -S '(' -q "$@" -a funcs +_alternative $alts -- cgit 1.4.1