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

Re: PATCH: glob flags at start of word



On Tue, 2018-12-04 at 16:53 +0000, Peter Stephenson wrote:
> ls (#<TAB>
> 
> doesn't complete as globbing flags are treated as a special case of glob
> qualifiers, which can't be completed here.
> 
> Fairly minor but I can't see any good reason not to fix it.

This might be safer...

pws

diff --git a/Completion/Unix/Type/_files b/Completion/Unix/Type/_files
index d44ac31..e3212c9 100644
--- a/Completion/Unix/Type/_files
+++ b/Completion/Unix/Type/_files
@@ -17,7 +17,7 @@ if _have_glob_qual $PREFIX; then
     _globquals && ret=0
   fi
   return ret
-elif [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\(\#'; then
+elif [[ $_comp_caller_options[extendedglob] == on && $PREFIX = \(\#[^\)]# ]] && compset -P '\(\#'; then
   # Globbing flags can start at beginning of word, even though
   # glob qualifiers can't.
   _globflags && return



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