zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Don't complete history modifiers when assigning parameter
@ 2023-10-16  8:39 Mikael Magnusson
  2023-10-16  8:44 ` Mikael Magnusson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2023-10-16  8:39 UTC (permalink / raw)
  To: zsh-workers

---
 Completion/Zsh/Type/_command_names | 4 ++--
 Completion/Zsh/Type/_parameters    | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index e77f9b72f6..26c87ffc3d 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -36,8 +36,8 @@ else
     'suffix-aliases:suffix alias:_suffix_alias_files'
     'reserved-words:reserved word:compadd -Qk reswords'
     'jobs:: _jobs -t'
-    'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"'
-    'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =[+"'
+    'parameters:: _parameters -h -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"'
+    'parameters:: _parameters -h -g "*association*~*readonly*" -qS\[ -r "\n\t\- =[+"'
   )
 
   if zstyle -t ":completion:${curcontext}:aliases" verbose; then
diff --git a/Completion/Zsh/Type/_parameters b/Completion/Zsh/Type/_parameters
index 7f6f33e0ee..45dbb881ae 100644
--- a/Completion/Zsh/Type/_parameters
+++ b/Completion/Zsh/Type/_parameters
@@ -6,7 +6,9 @@
 # If you specify a -g option with a pattern, the pattern will be used to
 # restrict the type of parameters matched.
 
-if compset -P '*:'; then
+local assignment
+zparseopts -D -K -E h=assignment
+if [[ $assignment != -h ]] && compset -P '*:'; then
   _history_modifiers p
   return
 fi
-- 
2.38.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: Don't complete history modifiers when assigning parameter
  2023-10-16  8:39 PATCH: Don't complete history modifiers when assigning parameter Mikael Magnusson
@ 2023-10-16  8:44 ` Mikael Magnusson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2023-10-16  8:44 UTC (permalink / raw)
  To: zsh-workers

Oops, disregard this, sent by mistake.

On 10/16/23, Mikael Magnusson <mikachu@gmail.com> wrote:
> ---
>  Completion/Zsh/Type/_command_names | 4 ++--
>  Completion/Zsh/Type/_parameters    | 4 +++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/Completion/Zsh/Type/_command_names
> b/Completion/Zsh/Type/_command_names
> index e77f9b72f6..26c87ffc3d 100644
> --- a/Completion/Zsh/Type/_command_names
> +++ b/Completion/Zsh/Type/_command_names
> @@ -36,8 +36,8 @@ else
>      'suffix-aliases:suffix alias:_suffix_alias_files'
>      'reserved-words:reserved word:compadd -Qk reswords'
>      'jobs:: _jobs -t'
> -    'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r
> "\n\t\- =[+"'
> -    'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r
> "\n\t\- =[+"'
> +    'parameters:: _parameters -h -g "^*(readonly|association)*" -qS= -r
> "\n\t\- =[+"'
> +    'parameters:: _parameters -h -g "*association*~*readonly*" -qS\[ -r
> "\n\t\- =[+"'
>    )
>
>    if zstyle -t ":completion:${curcontext}:aliases" verbose; then
> diff --git a/Completion/Zsh/Type/_parameters
> b/Completion/Zsh/Type/_parameters
> index 7f6f33e0ee..45dbb881ae 100644
> --- a/Completion/Zsh/Type/_parameters
> +++ b/Completion/Zsh/Type/_parameters
> @@ -6,7 +6,9 @@
>  # If you specify a -g option with a pattern, the pattern will be used to
>  # restrict the type of parameters matched.
>
> -if compset -P '*:'; then
> +local assignment
> +zparseopts -D -K -E h=assignment
> +if [[ $assignment != -h ]] && compset -P '*:'; then
>    _history_modifiers p
>    return
>  fi
> --
> 2.38.1
>
>


-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-16  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16  8:39 PATCH: Don't complete history modifiers when assigning parameter Mikael Magnusson
2023-10-16  8:44 ` Mikael Magnusson

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).