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

Re: PATCH: _groups and _condition



On Mar 12,  3:22pm, Oliver Kiddle wrote:
} Subject: PATCH: _groups and _condition
}
} Also here, is a patch against _condition so that it completes only files
} after more of its options.

This question isn't really directed at Oliver, but:

Out of curiosity, why doesn't _condition complete any of the options
themselves?  E.g. If I do

	zsh% [[ -<TAB>

it just inserts a space.  I expected it to list -n, -z, -t, etc.

} Incidentally, I had a look at whether it would be possible to add a
} completion for test and, more specifically, the '[' builtin. Putting
} [ or \[ after #compdef doesn't work.

I can't see any reason why it shouldn't.  (The form with no backslash.)
It works for me.  Did you remember to remove your ~/.zcompdump file?

} I can't use '[' as a key to an
} associative array if I use an assignment like: foo[\[]=whatever though
} it works fine if I do: a='[';foo[$a]=whatever or use an array style
} assignment.

That's because the string inside [ ] isn't tokenized yet at the point
where foo[\[] is tested by isident().  As a result, skipparens() finds
what appear to be unbalanced brackets.  This is a known bug with the
parser, resulting from the way associative arrays were grafted on.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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