From 1f6786ef7ae24ff858f52c6d4ac2bc23d529c0c1 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 12 Jul 1999 17:02:40 +0000 Subject: zsh-3.1.6-test-1 --- Src/Zle/zle_thingy.c | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'Src/Zle/zle_thingy.c') diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c index cf01f2fc1..f753b4769 100644 --- a/Src/Zle/zle_thingy.c +++ b/Src/Zle/zle_thingy.c @@ -340,7 +340,8 @@ bin_zle(char *name, char **args, char *ops, int func) { 'A', bin_zle_link, 2, 2 }, { 'N', bin_zle_new, 1, 2 }, { 'C', bin_zle_complete, 3, 3 }, - { 'R', bin_zle_refresh, 0, 1 }, + { 'R', bin_zle_refresh, 0, -1 }, + { 'U', bin_zle_unget, 1, 1 }, { 0, bin_zle_call, 0, -1 }, }; struct opn const *op, *opp; @@ -396,22 +397,49 @@ static int bin_zle_refresh(char *name, char **args, char *ops, char func) { char *s = statusline; - int sl = statusll; + int sl = statusll, ocl = clearlist; + statusline = NULL; + statusll = 0; if (*args) { - statusline = *args; - statusll = strlen(statusline); - } else { - statusline = NULL; - statusll = 0; - } + if (**args) { + statusline = *args; + statusll = strlen(statusline); + } + if (*++args) { + LinkList l = newlinklist(); + int zmultsav = zmult; + + for (; *args; args++) + addlinknode(l, *args); + + zmult = 1; + listlist(l); + showinglist = clearlist = 0; + zmult = zmultsav; + } else if (ops['c']) + clearlist = 1; + } else if (ops['c']) + clearlist = 1; zrefresh(); + clearlist = ocl; statusline = s; statusll = sl; return 0; } +/**/ +static int +bin_zle_unget(char *name, char **args, char *ops, char func) +{ + char *p = *args; + + while (*p) + ungetkey((int) *p++); + return 0; +} + /**/ static void scanlistwidgets(HashNode hn, int list) -- cgit 1.4.1