From: Bart Schaefer <schaefer@brasslantern.com>
To: Johan Grande <nahoj@crans.org>
Cc: zsh-workers@zsh.org
Subject: Re: [bug] Completion functions _files/_path_files -F filter on escaped file names
Date: Wed, 19 Jul 2023 22:15:46 -0700 [thread overview]
Message-ID: <CAH+w=7axa-EpfHP3ziEh8jomo2AwqVLNc9CV8SFh6C6Bkz5rdw@mail.gmail.com> (raw)
In-Reply-To: <c1145f4b-2569-6a80-e6e1-222c706739b0@crans.org>
[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]
Took me a while to get back to this, went on vacation and veered to other
topics.
On Sat, Jun 24, 2023 at 12:55 PM Johan Grande <nahoj@crans.org> wrote:
>
> After looking at your suggestion and other, existing completions such as
> _git, I get the impression that I shouldn't use _files but rather mimic
> its basic behavior with _multi_parts [...]
> If you have any tips or a good example to study, I'll be grateful.
>
The shortest possible example would be something like
local expl # set by _wanted
local tree=(**/*)
_wanted files expl 'files in tree' _multi_parts "$@" -f - / tree
The stuff you describe here ...
> - complete will all files under a path filtered with a regex or an
> arbitrary command
> - contrary to _git, I won't have a root dir so if I'm working in a
> directory with >10k files under it, I might want to suggest only
> immediate children in the first instance rather than browse everything
> at once.
>
... all goes into how you populate the "tree" array before calling
_multi_parts.
[-- Attachment #2: Type: text/html, Size: 1841 bytes --]
prev parent reply other threads:[~2023-07-20 5:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 19:29 Johan Grande
2023-06-22 3:54 ` Bart Schaefer
2023-06-24 19:55 ` Johan Grande
2023-07-20 5:15 ` Bart Schaefer [this message]
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='CAH+w=7axa-EpfHP3ziEh8jomo2AwqVLNc9CV8SFh6C6Bkz5rdw@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=nahoj@crans.org \
--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).