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

Re: PATCH: another match-words-by-style fix



Peter Stephenson wrote:
> We're heading into too-clever-by-half territory here...

Like I said...

Index: Functions/Zle/match-words-by-style
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zle/match-words-by-style,v
retrieving revision 1.4
diff -u -r1.4 match-words-by-style
--- Functions/Zle/match-words-by-style	9 Dec 2004 17:26:50 -0000	1.4
+++ Functions/Zle/match-words-by-style	9 Dec 2004 17:40:00 -0000
@@ -75,7 +75,7 @@
     local curcontext=:zle:match-words-by-style
 fi
 
-while getopts "w:s:c:C:tT" opt; do
+while getopts "w:s:c:C:" opt; do
   case $opt in
     (w)
     wordstyle=$OPTARG
@@ -140,12 +140,11 @@
 	    # Find out what's in front.
 	    eval pat1='${LBUFFER%%(#b)('${wordpat1}')('${spacepat}')}'
 	    # Now everything from ${#pat1}+1 is wordy
-	    wordpat1=${(q)LBUFFER[${#pat1}+1,-1]}
+	    wordpat1=${LBUFFER[${#pat1}+1,-1]}
+	    wordpat2=${RBUFFER[1,${#bufwords[$nwords]}-${#wordpat1}+1]}
 
-	    # Likewise at the end...
-	    eval pat2='${RBUFFER##(#b)('${charskip}${spacepat}')('\
-${wordpat2}')('${spacepat}')}'
-	    wordpat2=${(q)RBUFFER[1,-1-${#pat2}]}
+	    wordpat1=${(q)wordpat1}
+	    wordpat2=${(q)wordpat2}
 	  fi
 	  ;;
   (*space) spacepat='[[:space:]]#'

-- 
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