zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: Felix Rosencrantz <f_rosencrantz@yahoo.com>, zsh-workers@sunsite.dk
Subject: Re: Menu selection
Date: Wed, 3 Jul 2002 09:58:49 +0200	[thread overview]
Message-ID: <15650.44729.712285.387456@wischnow.berkom.de> (raw)
In-Reply-To: <20020627182621.70670.qmail@web10405.mail.yahoo.com>


You wrote:

> Here is a recipe, that causes a core dump for me:
> 
> host% autoload -U compinit; compinit -D
> host% zmodload zsh/complist
> host% bindkey "^Bm" menu-select
> host% bindkey "^Bi" vi-insert
> host% mkdir bug ; cd bug
> host% touch a b ba bb c
> host% more [^Bm]zsh: segmentation fault  $SHELL -f
> 
> I intended to do "^Bi" after "^Bm", since menu-select usually works for me.
> I've been seeing the problem with vi-insert.

(Sorry for the delay, Felix.)

Problem was that `dat' isn't set when the menu-select widget is called
(instead of calling menu selection via styles). This should fix it.


Bye
  Sven

Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.51
diff -u -r1.51 complist.c
--- Src/Zle/complist.c	26 Jun 2002 11:07:46 -0000	1.51
+++ Src/Zle/complist.c	3 Jul 2002 07:55:33 -0000
@@ -2201,9 +2201,9 @@
 	    menucomplete(zlenoargs);
 	    iforcemenu = 0;
 
-	    if (dat->num < 1 || !minfo.cur || !*(minfo.cur)) {
+	    if ((dat ? dat->num : nmatches) < 1 || !minfo.cur || !*(minfo.cur)) {
 		nolist = 1;
-		if (dat->nmesg || nmessages) {
+		if ((dat ? (dat->nmesg || nmessages) : nmessages)) {
 		    showinglist = -2;
 		    zrefresh();
 		} else {
@@ -2768,13 +2768,13 @@
     mselect = mlastcols = mlastlines = -1;
     mstatus = NULL;
     inselect = mhasstat = 0;
-    if (acc) {
+    if (acc && validlist && minfo.cur) {
 	menucmp = lastambig = hasoldlist = 0;
 	do_single(*(minfo.cur));
     }
     if (wasnext || broken) {
 	menucmp = 2;
-	showinglist = -2;
+	showinglist = (validlist ? -2 : 0);
 	minfo.asked = 0;
 	if (!noselect) {
 	    int nos = noselect;
@@ -2784,7 +2784,7 @@
 	}
     }
     if (!noselect && (!dat || acc)) {
-	showinglist = -2;
+	showinglist = (validlist ? -2 : 0);
 	onlyexpl = oe;
 	if (!smatches)
 	    clearlist = 1;

-- 
Sven Wischnowsky                          wischnow@berkom.de


       reply	other threads:[~2002-07-03  7:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <15642.49846.468542.689062@wischnow.berkom.de>
     [not found] ` <20020627182621.70670.qmail@web10405.mail.yahoo.com>
2002-07-03  7:58   ` Sven Wischnowsky [this message]
2002-07-04  9:27     ` Sven Wischnowsky
2002-07-04 17:56       ` Felix Rosencrantz
2002-07-05  8:09         ` Sven Wischnowsky
2002-07-24 23:01           ` Felix Rosencrantz
2002-07-30  7:47             ` Sven Wischnowsky
2002-06-18  7:57 Sven Wischnowsky
2002-06-18  9:51 ` Oliver Kiddle
2002-06-19  7:49   ` Sven Wischnowsky
2002-06-20 15:52     ` Oliver Kiddle
2002-06-20 15:58       ` Bart Schaefer
2002-06-20 16:22         ` Oliver Kiddle
2002-06-21  9:27       ` Sven Wischnowsky
2002-06-26 10:18         ` Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2002-05-28  8:31 Sven Wischnowsky
2002-05-28 10:44 ` Oliver Kiddle
2002-05-28 11:24   ` Sven Wischnowsky
2002-05-28 12:08 ` Peter Stephenson
2002-05-29 11:23   ` Sven Wischnowsky
2002-05-29 11:30     ` Peter Stephenson
2002-05-29 16:44 ` Felix Rosencrantz

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=15650.44729.712285.387456@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --cc=f_rosencrantz@yahoo.com \
    --cc=zsh-workers@sunsite.dk \
    /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).