From d3620a02dfad71562320a90315175855b44ed4de Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 11 May 2000 08:40:09 +0000 Subject: make ^G in menu-selection restore the old command line; add select=long* values for menu style to start menu-selection if list is too long for screen (11319) --- Src/Zle/compcore.c | 12 +++++++++++- Src/Zle/complist.c | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'Src/Zle') diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index 941023769..ee218e132 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -499,12 +499,22 @@ after_complete(Hookdef dummy, Compldat dat) { if (menucmp && !oldmenucmp) { struct chdata dat; + int ret; dat.matches = amatches; dat.num = nmatches; dat.cur = NULL; - if (runhookdef(MENUSTARTHOOK, (void *) &dat)) + if ((ret = runhookdef(MENUSTARTHOOK, (void *) &dat))) { menucmp = menuacc = 0; + if (ret == 2) { + cs = 0; + foredel(ll); + inststr(origline); + cs = origcs; + clearlist = 1; + invalidatelist(); + } + } } return 0; } diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c index 76fbaf58b..fdda07112 100644 --- a/Src/Zle/complist.c +++ b/Src/Zle/complist.c @@ -2135,7 +2135,7 @@ domenuselect(Hookdef dummy, Chdata dat) showinglist = -2; minfo.asked = 0; } - if (!noselect) { + if (!noselect && (!dat || acc)) { showinglist = -2; onlyexpl = oe; if (!smatches) @@ -2145,7 +2145,7 @@ domenuselect(Hookdef dummy, Chdata dat) mlbeg = -1; fdat = NULL; - return (!noselect ^ acc); + return (dat ? (acc ? 1 : 2) : (!noselect ^ acc)); } /* The widget function. */ -- cgit 1.4.1