* PATCH: complete glob qualifiers following an equals expansion
@ 2024-08-30 13:43 Oliver Kiddle
0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2024-08-30 13:43 UTC (permalink / raw)
To: Zsh workers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-08-30 13:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-30 13:43 PATCH: complete glob qualifiers following an equals expansion Oliver Kiddle
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).