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

PATCH: complete glob qualifiers following an equals expansion



It is valid and sometimes useful to put a glob qualifier on the end of
an equals expansion. Normally where globs apply, completion ends up in
_files or _path_files which is where completion checks for qualifiers.
But if the current word starts with =, _equal is used instead.

This patch adds similar code to _equal. I think any glob flag here would
be meaningless so have not replicated the _files code related to those.

Oliver

diff --git a/Completion/Zsh/Context/_equal b/Completion/Zsh/Context/_equal
index 58a415d56..5cdeea264 100644
--- a/Completion/Zsh/Context/_equal
+++ b/Completion/Zsh/Context/_equal
@@ -1,3 +1,11 @@
 #compdef -equal-
 
-_path_commands
+local -a match mbegin mend
+
+if _have_glob_qual $PREFIX; then
+  compset -p ${#match[1]}
+  compset -S '[^\)\|\~]#(|\))'
+  _globquals
+else
+  _path_commands
+fi




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