From 44c56f3af57d93d5d92ce18893cb020f8f36e2f3 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 29 Jun 2015 01:53:59 +0200 Subject: 35627: make reverse-menu-complete start with the last match in menu selection --- Src/Zle/compcore.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Src/Zle/compcore.c') diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index d4051bda0..ba538ca99 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -327,9 +327,7 @@ do_completion(UNUSED(Hookdef dummy), Compldat dat) haspattern = 0; complistmax = getiparam("LISTMAX"); zsfree(complastprompt); - complastprompt = ztrdup(((isset(ALWAYSLASTPROMPT) && zmult == 1) || - (unset(ALWAYSLASTPROMPT) && zmult != 1)) ? - "yes" : ""); + complastprompt = ztrdup(isset(ALWAYSLASTPROMPT) ? "yes" : ""); dolastprompt = 1; zsfree(complist); complist = ztrdup(isset(LISTROWSFIRST) ? @@ -975,7 +973,7 @@ makecomplist(char *s, int incmd, int lst) mnum = 0; unambig_mnum = -1; isuf = NULL; - insmnum = 1; + insmnum = zmult; #if 0 /* group-numbers in compstate[insert] */ insgnum = 1; -- cgit v1.2.3 From 68a5a5f453d9534748e12d268718a97b7e84c31b Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 6 Jul 2015 22:40:47 +0200 Subject: 35704: compadd -E 0 should imply -J and -2 --- ChangeLog | 5 +++++ Doc/Zsh/compwid.yo | 4 +++- Src/Zle/compcore.c | 4 ++-- Src/Zle/complete.c | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'Src/Zle/compcore.c') diff --git a/ChangeLog b/ChangeLog index 947d8b333..a7eb45224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-07-06 Oliver Kiddle + + * 35704: Doc/Zsh/compwid.yo, Src/Zle/compcore.c, Src/Zle/complete.c; + compadd -E 0 should imply -J and -2 + 2015-07-06 Mikael Magnusson * 35696: Completion/Unix/Type/_ps1234: complete colors for %F{ diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index 0c0a15d41..40cabea88 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -697,7 +697,9 @@ format completion lists and to make explanatory string be shown in completion lists (since empty matches can be given display strings with the tt(-d) option). And because all but one empty string would otherwise be removed, this option implies the tt(-V) and tt(-2) -options (even if an explicit tt(-J) option is given). +options (even if an explicit tt(-J) option is given). This can be +important to note as it affects the name space into which matches are +added. ) xitem(tt(-)) item(tt(-)tt(-))( diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index ba538ca99..ae3a64074 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -2049,7 +2049,7 @@ addmatches(Cadata dat, char **argv) Heap oldheap; SWITCHHEAPS(oldheap, compheap) { - if (dat->dummies) + if (dat->dummies >= 0) dat->aflags = ((dat->aflags | CAF_NOSORT | CAF_UNIQCON) & ~CAF_UNIQALL); @@ -2534,7 +2534,7 @@ addmatches(Cadata dat, char **argv) addmatch("", dat->flags | CMF_ALL, &disp, 1); hasallmatch = 1; } - while (dat->dummies--) + while (dat->dummies-- > 0) addmatch("", dat->flags | CMF_DUMMY, &disp, 0); } SWITCHBACKHEAPS(oldheap); diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index 471c9f491..30173927d 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -540,7 +540,7 @@ bin_compadd(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) dat.match = NULL; dat.flags = 0; dat.aflags = CAF_MATCH; - dat.dummies = 0; + dat.dummies = -1; for (; *argv && **argv == '-'; argv++) { if (!(*argv)[1]) { -- cgit v1.2.3