Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: up-line-or-search question
- X-seq: zsh-workers 16905
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: up-line-or-search question
- Date: Tue, 26 Mar 2002 14:30:47 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <8008.1016751391@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <11220.1014827397@xxxxxxx> <8008.1016751391@xxxxxxx>
- Sender: Oliver Kiddle <kiddleo@xxxxxxxxxx>
On Thu, Mar 21, 2002 at 10:56:31PM +0000, Peter Stephenson wrote:
> I'm going to commit the following. It's up to Oliver whether he wants
> to do something more sophisticated.
Sorry, I had forgotten about this.
I think the best to use is perhaps Martin Ebourne's from 16011. It is
as follows though I've modified it slightly so that it will do a down
line if we are back at the end of the history and so that you can force
a down history with a numeric argument. Does anyone think it is worth
it to incorporate Dominik Vogt's changes in users/4712 which basically
just account for lines containing only spaces and tabs?
In the function I use, I also have:
elif [[ -n $PREBUFFER ]]; then
zle .push-line-or-edit
in the middle of the up-line function (unfortuately adding an
up-line-or-history after push-line-or-edit doesn't seem to work). I
expect most users wouldn't expect this so I'll leave it out.
I was also hoping to move the cursor to the end of the line after
searches but I can't see how I can move it back before the next search
without using the mark. I was hoping someone else would answer the
question in users/4735 because I don't know the answer myself and
suspect it can't be done.
So, are there any objections if I commit the following instead? Peter's
documentation looks to still be entirely applicable.
Oliver
up-line-or-beginning-search() {
if [[ $LBUFFER == *$'\n'* ]]; then
zle .up-line-or-history
__searching=''
else
zle .history-beginning-search-backward
__searching=$WIDGET
fi
}
down-line-or-beginning-search() {
if [[ $LASTWIDGET = $__searching || $NUMERIC -gt 0 ]] &&
zle .history-beginning-search-forward; then
__searching=$WIDGET
elif [[ $RBUFFER == *$'\n'* ]]; then
__searching=''
zle .down-line-or-history
else
__searching=$WIDGET
zle .history-beginning-search-forward
fi
}
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author