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

Re: Menu-driven version of history-beginning-search-backward



I suppose this is going to come to an end soon.  It must be nice being
smart.

Index: Doc/Zsh/params.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/params.yo,v
retrieving revision 1.30
diff -u -r1.30 params.yo
--- Doc/Zsh/params.yo	1 Aug 2006 17:35:17 -0000	1.30
+++ Doc/Zsh/params.yo	1 Aug 2006 20:17:51 -0000
@@ -221,7 +221,7 @@
 match an element of an array tt($array) containing exactly the value of
 tt($key):
 
-example(key2=${key//(#m)[\][+LPAR()+RPAR()\\*?#<>]/\\$MATCH}
+example(key2=${key//(#m)[\][+LPAR()+RPAR()\\*?#<>~]/\\$MATCH}
 print ${array[(R)$key2]})
 )
 item(tt(R))(
Index: Functions/Zle/history-beginning-search-menu
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zle/history-beginning-search-menu,v
retrieving revision 1.3
diff -u -r1.3 history-beginning-search-menu
--- Functions/Zle/history-beginning-search-menu	1 Aug 2006 17:35:18 -0000	1.3
+++ Functions/Zle/history-beginning-search-menu	1 Aug 2006 20:17:51 -0000
@@ -40,12 +40,12 @@
 
 local search=$LBUFFER
 
+search=${search//(#m)[\][()\\*?#<>~]/\\$MATCH/}
 if [[ $WIDGET = *-space* ]]; then
   # We need to quote metacharacters in the search string
   # since they are otherwise active in the reverse subscript.
   # We need to avoid quoting other characters since they aren't
   # and just stay quoted, rather annoyingly.
-  search=${search//(#m)[\][()\\*?#<>]/\\$MATCH/}
   search=${search// /*}
 fi
 
@@ -112,7 +112,7 @@
 # go to the last one.  This allows accept-line-and-down-history etc.
 # to work.
 local -a lines
-local matchq=${matches[$chars]//(#m)[\][()\\*?#<>]/\\$MATCH}
+local matchq=${matches[$chars]//(#m)[\][()\\*?#<>~]/\\$MATCH}
 lines=(${(kon)history[(R)$matchq]})
 HISTNO=$lines[-1]
 
-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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