zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] Zsh crashes when reverse-menu-complete is invoked during complist MENUSELECT without 'menu:' in $compstate[insert]
Date: Sun, 30 May 2021 01:38:13 +0200	[thread overview]
Message-ID: <74731-1622331493.771443@x2v5.xEC7.Evn2> (raw)
In-Reply-To: <CAHLkEDvSRo6fOFhvS2A+qN4WAUJpD=jo6mO-faTUFDECc2m1ZQ@mail.gmail.com>

On 27 May, Marlon Richert wrote:
> Given:
>   * complist's MENUSELECT mode is active
>   * $compstate[insert] does not start with 'menu:'
> When:
>   * The user activates reverse-menu-complete.
> Then:
>   * Zsh crashes.

It calls reversemenucomplete() which is a function that pre-dates menu
selection. The path down which it clears minfo didn't look appropriate
from within menu selection. But it doesn't crash for forward menu
completion. Taking the same code path as for forward completion but
with zmult negated appears to work fine and would seem logical enough.
But perhaps there's some aspect to reversemenucomplete() that would be
needed so it'd be good if this can get some further testing.

Oliver

diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 429c8159f..353cb3562 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -3277,9 +3277,8 @@ domenuselect(Hookdef dummy, Chdata dat)
 		   !strcmp(cmd->nam, "reverse-menu-complete")) {
             mode = 0;
 	    comprecursive = 1;
-	    unmetafy_line();
-	    reversemenucomplete(zlenoargs);
-	    metafy_line();
+	    zmult = -zmult;
+	    do_menucmp(0);
 	    mselect = (*(minfo.cur))->gnum;
 	    setwish = 1;
 	    mline = -1;


      reply	other threads:[~2021-05-29 23:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27  8:20 Marlon Richert
2021-05-29 23:38 ` Oliver Kiddle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74731-1622331493.771443@x2v5.xEC7.Evn2 \
    --to=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).