mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-11 20:31:11 +01:00
allow using menu-select for compdef -k (i.e.: autoload zsh/complist in such cases) (11686)
This commit is contained in:
parent
7bf294f2b8
commit
fe8490dcf0
3 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2000-05-31 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 11686: Completion/Core/compdump, Completion/Core/compinit: allow
|
||||
using menu-select for compdef -k (i.e.: autoload zsh/complist in
|
||||
such cases)
|
||||
|
||||
2000-05-31 Peter Stephenson <pws@cambridgesiliconradio.com>
|
||||
|
||||
* Wayne Davison: 11680: Src/params.c: subscript too small/big
|
||||
|
|
|
@ -62,9 +62,14 @@ print >> $_d_file
|
|||
# argument to zle does not begin with a `_').
|
||||
|
||||
_d_bks=()
|
||||
_d_complist=
|
||||
zle -lL |
|
||||
while read -rA _d_line; do
|
||||
if [[ ${_d_line[3]} = _* && ${_d_line[5]} = _* ]]; then
|
||||
if [[ -z "$_d_complist" && ${_d_line[4]} = .menu-select ]]; then
|
||||
print 'zmodload -i zsh/complist'
|
||||
d_complist=yes
|
||||
fi
|
||||
print -r - ${_d_line}
|
||||
_d_bks=($_d_bks ${_d_line[3]})
|
||||
fi
|
||||
|
|
|
@ -232,6 +232,7 @@ compdef() {
|
|||
fi
|
||||
[[ $1 = _* ]] || 1="_$1"
|
||||
[[ $2 = .* ]] || 2=".$2"
|
||||
[[ $2 = .menu-select ]] && zmodload -i zsh/complist
|
||||
zle -C "$1" "$2" "$func"
|
||||
if [[ -n $new ]]; then
|
||||
bindkey "$3" | read -A opt
|
||||
|
@ -250,8 +251,10 @@ compdef() {
|
|||
|
||||
# Define the widget.
|
||||
if [[ $1 = .* ]]; then
|
||||
[[ $1 = .menu-select ]] && zmodload -i zsh/complist
|
||||
zle -C "$func" "$1" "$func"
|
||||
else
|
||||
[[ $1 = menu-select ]] && zmodload -i zsh/complist
|
||||
zle -C "$func" ".$1" "$func"
|
||||
fi
|
||||
shift
|
||||
|
|
Loading…
Reference in a new issue