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

Re: matlab-history-beginning-search-backward



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