Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
_expand_word_and_keep of 'keeper suite' doesn't work
- X-seq: zsh-users 9727
- From: Hannu Koivisto <azure@xxxxxx>
- To: Zsh Users' List <zsh-users@xxxxxxxxxx>
- Subject: _expand_word_and_keep of 'keeper suite' doesn't work
- Date: Thu, 01 Dec 2005 11:57:25 +0200
- Mail-copies-to: nobody
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Sender: Hannu Koivisto <Hannu.Koivisto@xxxxxxxxxxx>
Greetings,
The version of _expand_word_and_keep below (from the magazine
article) doesn't seem to work in at least 4.2.5. For some reason
the condition [[ $args[-J] == all-expansions ]] is never true when
and nothing is put to the kept variable. I have no idea of what that
condition is there for, but just for the heck of it I tried
removing it completely. Then, ... *.jpg<C-x e> caused *.jpg to be
put to the kept variable.
Any ideas?
_expand_word_and_keep() {
function compadd() {
local -A args
zparseopts -E -A args J:
if [[ $args[-J] == all-expansions ]]; then
builtin compadd -A kept "$@"
kept=( ${(Q)${(z)kept}} )
fi
builtin compadd "$@"
}
local result
_main_complete _expand
result=$?
unfunction compadd
return result
}
zle -C _expand_word complete-word _expand_word_and_keep
--
Hannu
Messages sorted by:
Reverse Date,
Date,
Thread,
Author