zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: RE: completion widgets in menu selection
Date: Wed, 11 Oct 2000 12:55:41 +0200 (MET DST)	[thread overview]
Message-ID: <200010111055.MAA26535@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Wed, 11 Oct 2000 13:15:08 +0400


Andrej Borsenkow wrote:

> ...
> 
> > The more I think about this, the more sense does it seem to make,
> > especially because this allows everything that was possible before
> > plus some.
> 
> One problem. How should undo after this second widget behave? Curretly it
> leaves the last match, selected in menu selection, inserted and forgets about
> list.

I've modified the patch to make it go back to where it was when menu
selection was started.

I'm going to commit this version of the patch.

> It would be very nice if it returned to menu selection ... but I do not
> know how difficult it is.

Very. At that time it has left the menu selection code and doesn't
have any information about the state that was in any more.

> More general. With amount of state information kept in compstate it is very
> easy to write separate bindable commands that modify generated lists.

One can currently only say what to do with that list, display-wise and 
insertion-wise.

> It would
> be very nice if undo returned to previous state in this case.

Hm, maybe, yes. The problem is that the undo-stuff isn't handled by
the completion code but by the zle main loop, so we don't really have
any control over it, other than inserting additional undo-return
points -- the opposite of what you want.

Maybe it's one of the things you can bring to our minds when (and if)
we try to improve zle and the integration of completion widgets into
zle after 4.0.

Bye
 Sven

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.39
diff -u -r1.39 compcore.c
--- Src/Zle/compcore.c	2000/10/04 13:24:45	1.39
+++ Src/Zle/compcore.c	2000/10/11 10:49:38
@@ -524,14 +524,16 @@
 	    dat[1] = 0;
 	    menucmp = menuacc = 0;
 	    minfo.cur = NULL;
-	    if (ret == 2) {
+	    if (ret >= 2) {
 		fixsuffix();
 		cs = 0;
 		foredel(ll);
 		inststr(origline);
 		cs = origcs;
-		clearlist = 1;
-		invalidatelist();
+		if (ret == 2) {
+		    clearlist = 1;
+		    invalidatelist();
+		}
 	    }
 	}
     }
Index: Src/Zle/complist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/complist.c,v
retrieving revision 1.32
diff -u -r1.32 complist.c
--- Src/Zle/complist.c	2000/07/03 08:05:28	1.32
+++ Src/Zle/complist.c	2000/10/11 10:49:38
@@ -2237,7 +2237,11 @@
 	    continue;
 	} else {
 	    ungetkeycmd();
-	    acc = 1;
+	    if (cmd->widget && (cmd->widget->flags & WIDGET_NCOMP)) {
+		acc = 0;
+		broken = 2;
+	    } else
+		acc = 1;
 	    break;
 	}
 	do_single(**p);
@@ -2260,6 +2264,7 @@
 	menucmp = 2;
 	showinglist = -2;
 	minfo.asked = 0;
+	zrefresh();
     }
     if (!noselect && (!dat || acc)) {
 	showinglist = -2;
@@ -2271,7 +2276,8 @@
     mlbeg = -1;
     fdat = NULL;
 
-    return ((dat && !broken) ? (acc ? 1 : 2) : (!noselect ^ acc));
+    return (broken == 2 ? 3 :
+	    ((dat && !broken) ? (acc ? 1 : 2) : (!noselect ^ acc)));
 }
 
 /* The widget function. */

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


                 reply	other threads:[~2000-10-11 10:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200010111055.MAA26535@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).