Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: matlab-history-beginning-search-backward
- X-seq: zsh-users 14446
- From: Guido van Steen <gvsteen@xxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: matlab-history-beginning-search-backward
- Date: Thu, 1 Oct 2009 13:58:25 -0700 (PDT)
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1254430705; bh=g2bIGolEg85oISFjdiXPO1SJ2ymNOvrnn/SZEwq8b4k=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=I8mCG8SLr/iZCmTMjtGP0V8SFtSeeD6BzM2eLretmqq7Tf7YKdxf7p4HYqCr72uLB1L2BsFexTim/HYCEm2z7fLpbKrzaB93i0hn+9BUTgFic8VokJo6pDUwBDB0V/6dwx1cGzNqsK+qtjIDVgw0Jv+xHpZqFzzfFNkEPKsRGp0=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=B1bDUsFawr9FFMU/XKGU2qhVl40xgmPdpNCzSbwJhzTYFUjMH+ID8oS1nruN0yO8atP2kHnuIlIy5nxIfJ4fUrJDBarnLjycQ3IVRALYwvJ6b/Fqa+qgmzDbk2scoUF5+zAcGUj/OTydEEotFI25kpsRWNIKxwICzbxAR142Klc=;
- In-reply-to: <200910010838.n918cMiM025545@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Dear Peter,
I am impressed by the code. It works well - apart from the
cursor stuff. I tried to understand it, but I failed.
I have two questions:
* Which part of the code makes sure that the commands retrieved
from history are "shown" on the command line?
* Why does the cursor position matter, and how can one make sure
that the cursor moves to the right position before the widget is
invoked?
Best wishes,
Guido
--- On Thu, 10/1/09, Peter Stephenson <pws@xxxxxxx> wrote:
> From: Peter Stephenson <pws@xxxxxxx>
> Subject: Re: matlab-history-beginning-search-backward
> To: zsh-users@xxxxxxxxxx
> Date: Thursday, October 1, 2009, 10:38 AM
> Peter Stephenson wrote:
> > I stole a lot of it from
> > history-beginning-search-menu.
>
> ... and I've just noticed because of that a couple of bits
> are nonsense ...
>
> > local search=$LBUFFER MATCH MBEGIN MEND
>
> ... this assignment is redundant ...
>
> > # Filter out any match that's the same as the
> original.
> > # Note this isn't a pattern this time.
> > matches=(${matches:#${LBUFFER}})
>
> ... more importantly, because in this case $matches is an
> array of
> numbers this doesn't do anything (except stop you from
> matching a
> history line whose number happens to match the string to
> the left of the
> cursor). This filter would need to be moved up to
> where the matching is
> originally done. It's minor, though.
>
> --
> Peter Stephenson <pws@xxxxxxx>
> Software Engineer
> Tel: +44 (0)1223 692070
> Cambridge Silicon
> Radio Limited
> Churchill House, Cambridge Business Park, Cowley Road,
> Cambridge, CB4 0WZ, UK
>
>
>
>
> Member of the CSR plc group of companies. CSR plc
> registered in England and Wales, registered number 4187346,
> registered office Churchill House, Cambridge Business Park,
> Cowley Road, Cambridge, CB4 0WZ, United Kingdom
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author