Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: _history-complete-older problems with $(



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