Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Strange _values completion on accept-and-menu-complete and menu selection



For a long time I have the following bindings:
{pts/1}% bindkey -M menuselect
...
"," accept-and-menu-complete
"/" accept-and-infer-next-history

Apparently it does not work any more for _values; I presume it did work once 
because _urpmi completion includes _values usage in question.

Consider:

function _foo () {
        _values -s , "test completion" 'foo: :(1 2 3)' bar baz
}

compdef _foo foo

now start completion:

{pts/2}% foo bar,
Completing test completion
bar  baz  foo
^^^ highlighted

so far so good. But if I press ',' now (assuming complete current value and go 
on) I get

{pts/2}% foo bar baz,
Completing test completion
bar  baz  foo
     ^^^ highlighted

so auto-suffix is removed while it apparently should not to be?

OTOH doing

pts/2}% foo bar,
Completing test completion
bar  baz  foo
^^^ highlighted

now press "b" TAB gives you (as expected)

pts/2}% foo bar,baz,
Completing test completion
bar  baz  foo

Even more interesting with subvalue:

{pts/2}% foo foo=
Completing test completion
bar  baz  foo

press '/'

{pts/2}% foo foo=1,
1  2  3

OK so ENTER (to accept it) TAB you get

{pts/2}% foo foo=1,bar,
Completing test completion
bar  baz

and pressing ',' now results in

{pts/2}% foo foo=1,bar foo=1,baz,
Completing test completion
bar  baz

so something strange goes on when menu selection is used.

non default settings:

bindkey -e
bindkey '^I' complete-word
bindkey '^[q' push-line-or-edit
bindkey -M menuselect , accept-and-menu-complete
bindkey -M menuselect / accept-and-infer-next-history

setopt autopushd
setopt cdablevars

setopt extendedhistory
setopt extendedglob

setopt histexpiredupsfirst
setopt histignorealldups
setopt histignoredups
setopt histreduceblanks
setopt histsavenodups

setopt ignoreeof

setopt menucomplete

setopt nobanghist
setopt nolistambiguous
setopt nolistbeep

setopt pushdminus

# The following lines were added by compinstall
autoload -U compinit
compinit

zstyle ':completion:*' auto-description ''''specify: %d''''
zstyle ':completion:*' completer _oldlist _complete _match
zstyle ':completion:*' format ''''Completing %d''''
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the 
character
to insert%s'
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-z}={A-Z} r:|
[._-]=*
* r:|=**'
zstyle ':completion:*' match-original both
zstyle ':completion:*' menu select=0
zstyle ':completion:*' verbose true
zstyle :compinstall filename '/home/bor/.zshrc'
# End of lines added by compinstall


zstyle ':completion:*' list-rows-first true
zstyle ':completion:*:paths' accept-exact true

regards

-andrey



Messages sorted by: Reverse Date, Date, Thread, Author