Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _history-complete-older problems with $(
- X-seq: zsh-workers 37593
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Subject: Re: _history-complete-older problems with $(
- Date: Wed, 13 Jan 2016 01:01:36 +0000
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- In-reply-to: <CAKc7PVBCEM=46YmgmhPR==Rq+pSfY+hgr8bcOMLV=zLFm6THBg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCnEX1rEhNqhtx7spyUVKCWukz4Tzkqr27-OV9+4hVciQ@mail.gmail.com> <CAKc7PVDVR=B8SWX+gSiNvtODWZ-25LtDz7jXVDH8BtrcxMnjXQ@mail.gmail.com> <160111161501.ZM5305@torch.brasslantern.com> <CAKc7PVBCEM=46YmgmhPR==Rq+pSfY+hgr8bcOMLV=zLFm6THBg@mail.gmail.com>
Sebastian Gniazdowski wrote on Tue, Jan 12, 2016 at 14:09:47 +0100:
> On 12 January 2016 at 01:15, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > _widen_for_history () {
> > local -a left=( "${(z)LBUFFER}" )
Strictly speaking, ${(z)} should always be applied to $PREBUFFER$LBUFFER
or $PREBUFFER$BUFFER, not merely to $BUFFER, otherwise things like
string literals with embedded newlines can confuse the result.
> > This needs some work around the issue of empty words, i.e., when
> > completing in empty parens such as $(<TAB>) then $words[CURRENT] is
> > empty and the trailing paren must be copied from $RBUFFER to SUFFIX.
> > I haven't dived into that detail.
>
> I would gladly perform the work but the code is quite difficult. Could
> you state in one sentence what it is doing?
Bart's function runs the _history completer with $words modified to
reflect the entire command-line "list"¹ rather than only the "simple
command"¹ the cursor happens to be in.
Cheers,
Daniel
¹ Terms from zshmisc(1).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author