zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@zsh.org
Subject: bug with hidden prefixes
Date: Thu, 11 Jun 2015 14:09:37 +0200	[thread overview]
Message-ID: <16400.1434024577@thecus.kiddle.eu> (raw)
In-Reply-To: <18592.1433197179@thecus.kiddle.eu>

On 2 Jun, I wrote:
> This _ttys function allows the /dev/ prefix to be optional, required or
> stripped. I think there's a bug somewhere in the hidden prefix handling
> that this shows up, however.

I'll just elaborate on this in case someone else has more success than
me in tracking this down. The bug exists even in zsh 3.1.7 so is not
something that got introduced later. The following are the minimal steps
to reproduce it:

_foo() {
  local ret=1
  compadd -p /dev/ -M 'r:|/=* r:|=*' one two && ret=0
  compadd three && ret=0
  return ret
}
compdef _foo foo
foo /d<tab>

This should insert /dev/ because it is an unambiguous prefix to both
possible matches: three can be ruled out. The two matches are listed, it
is just that the prefix is not inserted. Without either the matching
control or the third match being there, it works.

Oliver


  reply	other threads:[~2015-06-11 12:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-23 10:15 [PATCH] completion: Add FreeBSD's watch(1) Daniel Shahaf
2015-06-01 22:19 ` Oliver Kiddle
2015-06-11 12:09   ` Oliver Kiddle [this message]
2015-06-11 15:45     ` bug with hidden prefixes Bart Schaefer
2015-06-11 15:53       ` Roman Neuhauser
2015-06-11 16:35         ` Bart Schaefer
2015-06-11 11:24 ` [PATCH] completion: Add FreeBSD's watch(1) Daniel Shahaf

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=16400.1434024577@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --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).