Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZLE Widget: Insert last word (except &)
- X-seq: zsh-users 3275
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Christoph Lange <duke@xxxxxxxxxxxxxx>
- Subject: Re: ZLE Widget: Insert last word (except &)
- Date: Wed, 12 Jul 2000 15:33:05 -0700 (PDT)
- Cc: zsh-users@xxxxxxxxxxxxxx
- In-reply-to: <Pine.LNX.4.10.10007122306210.9316-100000@xxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- Reply-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Sender: schaefer@xxxxxxxxxxxxxxxxx
On Wed, 12 Jul 2000, Christoph Lange wrote:
> I didn't understand all of it, but now the functions even fails doing
> elementar things:
>
> % echo a &
> a
> % echo
> ^ [Alt+.] pressed
Oops; I tried to edit a cut'n'paste screwup in place, and accidentally
re-inserted a line from the old version. Change ((--i)) to ((++i)) in the
`else' inside the `while' loop. Sorry about that.
> I found out another interesting thing about my first version. zsh goes up in
> the history on subsequent calls of insert-last-word, but from the widget's
> point of view, the position in the history remains the same. Either
> determining the previous line with `fc -n -l -1' or -- like in your widget
> -- going up the history and reading from $BUFFER always returns the previous
> line relative from the position where the user started calling
> insert-last-word.
That's why I had to the goofy bit with ((NUMERIC=_ilw_count+1)) in my
revised version. That makes up-history go up the correct number of lines,
and down-history go back down the correct number.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author