zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Felipe Contreras <felipe.contreras@gmail.com>, zsh-workers@zsh.org
Subject: Re: Issue with directory word completion
Date: Sun, 21 Apr 2013 11:44:24 -0700	[thread overview]
Message-ID: <130421114424.ZM6610@torch.brasslantern.com> (raw)
In-Reply-To: <CAMP44s2U3Mx+X__usCcp5adQwYOLwfpWudm3uVzA7Nktxp8Frw@mail.gmail.com>

On Apr 21,  6:22am, Felipe Contreras wrote:
}
} compadd -f -- 'Documents' 'Downloads/'

You're not supposed to include a trailing slash on the compadd string.
The completion system will figure that out on its own and append the
slash if appropriate.  Note from the docs for -f:

          ... all of the matches built from WORDS are
          marked as being the names of files.  They are not required to
          be actual filenames ...

"Downloads/" is not an "actual filename" so it's marked as a file.  The
"actual filename" of the directory is "Downloads".

I can already hear your objection, but what you're running into here is
a division-of-labor decision:  the calling shell code is capable of doing
the slash removal, and therefore it is left to it to do so rather than
complicate the already fairly incomprehensible internals even further.


  parent reply	other threads:[~2013-04-21 18:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-21 11:22 Felipe Contreras
2013-04-21 11:22 ` Felipe Contreras
2013-04-21 18:44 ` Bart Schaefer [this message]
2013-04-21 20:44   ` Felipe Contreras

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=130421114424.ZM6610@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=felipe.contreras@gmail.com \
    --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).