Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix a logic bug in _zle
- X-seq: zsh-workers 48969
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Fix a logic bug in _zle
- Date: Mon, 31 May 2021 20:48:28 +0300
- Archived-at: <https://zsh.org/workers/48969>
- In-reply-to: <CAH+w=7YHiEnxSNh65Z4K+Fuz+x_KyZZycZnUG1ArfhF6hQirmg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDu=pKddp9wtU8C7++ZqNdq3ajBmfjNnB1TN0pMaBn-QJQ@mail.gmail.com> <CAH+w=7YHiEnxSNh65Z4K+Fuz+x_KyZZycZnUG1ArfhF6hQirmg@mail.gmail.com>
On Mon, May 31, 2021 at 8:08 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> For purposes of the commit log, we should be told what this means in
> terms of a behavior change.
Is it good enough this way?
From f3be8c5cefd5251ad9317fe5ca11a400f6e9ffe1 Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlon.richert@xxxxxxxxx>
Date: Mon, 31 May 2021 20:45:58 +0300
Subject: [PATCH] Fix a bug where, if $state[1] == widget-function, _zle would
always return 0
---
Completion/Zsh/Command/_zle | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Completion/Zsh/Command/_zle b/Completion/Zsh/Command/_zle
index e01d0a943..0b8ef7a15 100644
--- a/Completion/Zsh/Command/_zle
+++ b/Completion/Zsh/Command/_zle
@@ -51,11 +51,11 @@ case "$state[1]" in
;;
(widget*)
_wanted -C "$context[1]" widgets expl "${state_descr[1]:-widget}" _widgets && ret=0
- ;&
- (function)
- [[ $state[1] != *function ]] || # Handle fall-through
+ ;|
+ (*function)
_wanted -C "$context[1]" functions expl 'widget shell function' \
- compadd -M 'r:|-=* r:|=*' -k functions && ret=0
+ compadd -M 'r:|-=* r:|=*' -k functions &&
+ ret=0
;;
(comp-widget)
_wanted -C "$context[1]" widgets expl 'completion widget' \
--
2.30.1 (Apple Git-130)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author