From 485a008075ce19bfdf19922c803d1637ebb5255e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sat, 23 Feb 2008 00:10:24 +0000 Subject: 24585: completion for glob qualifiers plus bug fix for _alternative --- Completion/Zsh/Type/_globqual_delims | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Completion/Zsh/Type/_globqual_delims (limited to 'Completion/Zsh/Type/_globqual_delims') diff --git a/Completion/Zsh/Type/_globqual_delims b/Completion/Zsh/Type/_globqual_delims new file mode 100644 index 000000000..bba4241e8 --- /dev/null +++ b/Completion/Zsh/Type/_globqual_delims @@ -0,0 +1,24 @@ +#autoload + +# Helper for _globquals. Sets delim to delimiter to match. + +# don't restore special parameters +compstate[restore]=no + +delim=$PREFIX[1] +compset -p 1 + +# One of matching brackets? +# These don't actually work: the parser gets very confused. +local matchl="<({[" matchr=">)}]" +integer ind=${matchl[(I)$delim]} + +(( ind )) && delim=$matchr[ind] + +if compset -P "[^$delim]#$delim"; then + # Completely matched. + return 0 +else + # Still in delimiter + return 1 +fi -- cgit 1.4.1