zsh-workers
 help / color / mirror / code / Atom feed
From: Martin Vaeth <martin@mvath.de>
To: zsh-workers@zsh.org
Subject: Strange completion display with wrong matcher-list
Date: Sat, 7 Jan 2017 07:49:38 +0000 (UTC)	[thread overview]
Message-ID: <slrno717cn.509.martin@lounge.imp.fu-berlin.de> (raw)

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


             reply	other threads:[~2017-01-07  8:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-07  7:49 Martin Vaeth [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrno717cn.509.martin@lounge.imp.fu-berlin.de \
    --to=martin@mvath.de \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).