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

Re: PATCH: Completion matching control test. (Try 2)



> On May 16,  9:11pm, Felix Rosencrantz wrote:
> } --- Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> } > This works for me:
> } > 
> } > 	print -lr "COMPADD:{${match[6]//[$'\r\n']/}}"
> } 
> } Great. Works for me, too.  Will use that.  I'll send a patch when the
> } changes make it into the repository.
There's no need to call "tr".  Where possible we should use zsh.
So here's the patch.

-FR.

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
Index: Test/comptest
===================================================================
--- zsh/Test/,comptest	Wed May 17 05:31:32 2000
+++ zsh/Test/comptest	Wed May 17 19:23:40 2000
@@ -107,8 +107,7 @@
       elif (( 0 <= $mbegin[5] )); then
 	print -lr "MESSAGE:{$match[5]}"
       elif (( 0 <= $mbegin[6] )); then
-        result=`echo $match[6] | tr -d '\012\015'`
-        print -lr "COMPADD:{$result}"
+        print -lr "COMPADD:{${${match[6]}//[$'\r\n']/}}"
       fi
     done
   done


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