zsh-workers
 help / color / mirror / code / Atom feed
* Strange completion display with wrong matcher-list
@ 2017-01-07  7:49 Martin Vaeth
  2017-01-07  8:10 ` Martin Vaeth
  2017-01-07  9:39 ` Oliver Kiddle
  0 siblings, 2 replies; 6+ messages in thread
From: Martin Vaeth @ 2017-01-07  7:49 UTC (permalink / raw)
  To: zsh-workers

Is the following a bug in zsh?
I have in my .zshrc:

zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'

I had copied it somewhere from the net, but it seems
to me now that the first entry (the empty string) is buggy.
However, instead of an error message or reliably wrong behaviour,
it triggers a very strange thing.

For some(!) completion functions in some(!) zsh versions,
when I press "tab" twice, the display of the options is broken.
Below is a minimal example of a completion file which breaks with
zsh-5.3.1 and the above zstyle.

Note that very subtle changes to the function
(e.g. replacing ->cmds directly by _files)
avoid the problem.
Or maybe the function is using -> in a broken manner?

The behavior is this: After pressing "my -<tab><tab>" I see
something unreadable like (in this case)

--long
-s
-- an option
--long
-s
-- an option

instead of the expeected

--long  -s  -- an option

Here is the (broken?) completion file:

#compdef my
local curcontext="$curcontext" state state_descr line
typeset -A opt_args
_arguments -C : \
{'(--long)-s','(-s)--long'}'[an option]' \
'1:an arg:->cmds'
local ret=$?
case $state in
(cmds)
	_files
	ret=$?;;
esac
return ret


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-07 22:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-07  7:49 Strange completion display with wrong matcher-list Martin Vaeth
2017-01-07  8:10 ` Martin Vaeth
2017-01-07  9:39 ` Oliver Kiddle
2017-01-07 13:54   ` Martin Vaeth
2017-01-07 21:21     ` Oliver Kiddle
2017-01-07 22:15       ` Martin Vaeth

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).