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

Re: vared 'functions[xx]'



On Thu, 13 Dec 2007 17:27:07 +0000
Stephane Chazelas <stephane_chazelas@xxxxxxxx> wrote:
> I had an odd behavior here.
> 
> ~$ a() echo foo
> ~$ vared functions\[a\]\
> 
> Above, the trailing "\ " was added by the completion system.

This stops that happening.  I think it's fine in that we certainly need
one level less of quoting to the space than to the square brackets.
However, if there are multiple levels of quoting involved it gets
hairier.  That's probably not a problem in practice.

I'll see if there's something funny in vared separately.

Index: Completion/Zsh/Context/_subscript
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Context/_subscript,v
retrieving revision 1.11
diff -u -r1.11 _subscript
--- Completion/Zsh/Context/_subscript	16 Apr 2002 07:48:46 -0000	1.11
+++ Completion/Zsh/Context/_subscript	13 Dec 2007 21:22:23 -0000
@@ -3,8 +3,8 @@
 local expl ind osuf=']' flags sep
 
 if [[ "$1" = -q ]]; then
-  osuf='] '
   compquote osuf
+  osuf+=' '
   shift
 fi
 

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