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

Re: !!:$



Stephane Chazelas wrote:
> Wouldn't it be the same as ${(%):-%!}?

Yes, except much more obvious.

Bart wrote:
> Umm.
> 
> HISTNO (integer)
>      The current history number.  Setting this has the same effect as
>      moving up or down in the history to the corresponding history line.
>      An attempt to set it is ignored if the line is not stored in the
>      history.
> 
> Admittedly this is available only in widgets, but it seems odd to have two
> variables for the same thing.

You didn't read down the patch far enough.

+history.  Note this is not the same as the parameter tt(HISTCMD),
+which always give the number of the history line being added to the main
+shell's history.  tt(HISTNO) refers to the line being retrieved within
+zle.

>> Then you can always get the full previous line as
>> $history[$((HISTCMD-1))].
>
> Unfortunately that doesn't always work.  If you setopt HIST_IGNORE_DUPS,
> $history[$((HISTNO-1))] may be empty.

That's a nuisance.  Maybe we need an ordinary array which always gives
the last items in the history, too.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author