about summary refs log tree commit diff
path: root/Src/Zle/zle_thingy.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c44
1 files changed, 36 insertions, 8 deletions
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,23 +397,50 @@ 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)
 {