From 146374a2af8cbc7674374b44ef6c963ee008e8a2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 17 Mar 2013 20:53:44 +0000 Subject: improved math context completion: functions --- Completion/Zsh/Type/.distfiles | 3 +++ Completion/Zsh/Type/_math_params | 3 +++ Completion/Zsh/Type/_module_math_func | 9 +++++++++ Completion/Zsh/Type/_user_math_func | 9 +++++++++ 4 files changed, 24 insertions(+) create mode 100644 Completion/Zsh/Type/_math_params create mode 100644 Completion/Zsh/Type/_module_math_func create mode 100644 Completion/Zsh/Type/_user_math_func (limited to 'Completion/Zsh/Type') diff --git a/Completion/Zsh/Type/.distfiles b/Completion/Zsh/Type/.distfiles index 74a4e101d..4011353a0 100644 --- a/Completion/Zsh/Type/.distfiles +++ b/Completion/Zsh/Type/.distfiles @@ -15,10 +15,13 @@ _jobs _jobs_bg _jobs_fg _limits +_math_params +_module_math_func _options _options_set _options_unset _parameters _suffix_alias_files +_user_math_func _vars ' diff --git a/Completion/Zsh/Type/_math_params b/Completion/Zsh/Type/_math_params new file mode 100644 index 000000000..8a4b9e1b6 --- /dev/null +++ b/Completion/Zsh/Type/_math_params @@ -0,0 +1,3 @@ +#autoload + +_parameters -g '(integer|float)*' || _parameters diff --git a/Completion/Zsh/Type/_module_math_func b/Completion/Zsh/Type/_module_math_func new file mode 100644 index 000000000..4df8d9714 --- /dev/null +++ b/Completion/Zsh/Type/_module_math_func @@ -0,0 +1,9 @@ +#autoload + +local expl +local -a funcs + +funcs=(${${${(f)"$(zmodload -Fl zsh/mathfunc 2>/dev/null)"}:#^+f:*}##+f:}) + +_wanted module-math-functions expl 'math function from zsh/mathfunc' \ + compadd -S '(' "$@" -a funcs diff --git a/Completion/Zsh/Type/_user_math_func b/Completion/Zsh/Type/_user_math_func new file mode 100644 index 000000000..16774f70b --- /dev/null +++ b/Completion/Zsh/Type/_user_math_func @@ -0,0 +1,9 @@ +#autoload + +local expl +local -a funcs + +funcs=(${${${(f)"$(functions -M)"}##functions -M }%% *}) + +_wanted user-math-functions expl 'user math function' \ + compadd -S '(' "$@" -a funcs -- cgit 1.4.1