From fd25b24df6b4f098944c4994195d3894a27a8208 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 31 May 2000 09:38:25 +0000 Subject: use compadd -[ak] (11549) --- Completion/Commands/_bash_completions | 5 +++-- Completion/Commands/_history_complete_word | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'Completion/Commands') diff --git a/Completion/Commands/_bash_completions b/Completion/Commands/_bash_completions index 548888138..50600290d 100644 --- a/Completion/Commands/_bash_completions +++ b/Completion/Commands/_bash_completions @@ -28,12 +28,13 @@ setopt localoptions nullglob rcexpandparam extendedglob unsetopt markdirs globsubst shwordsplit nounset ksharrays -local key=$KEYS[-1] +local key=$KEYS[-1] expl case $key in '!') _main_complete _command_names ;; - '$') compadd - "${(@k)parameters[(R)*export*]}" + '$') _main_complete - _wanted parameters expl 'exported parameters' \ + compadd - "${(@k)parameters[(R)*export*]}" ;; '@') _main_complete _hosts ;; diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word index bb7e44200..00d7ba369 100644 --- a/Completion/Commands/_history_complete_word +++ b/Completion/Commands/_history_complete_word @@ -70,7 +70,7 @@ _history_complete_word () { } _history_complete_word_gen_matches () { - local opt + local opt h_words [[ -n "$_hist_stop" ]] && PREFIX="$_hist_old_prefix" @@ -85,8 +85,9 @@ _history_complete_word_gen_matches () { opt="${opt}V" fi + h_words=( "${(@)historywords[2,-1]}" ) _wanted "$opt" history-words expl 'history word' \ - compadd -Q - "$historywords[@]" + compadd -Q -a h_words zstyle -t ":completion:${curcontext}:history-words" list || compstate[list]= -- cgit v1.2.3