about summary refs log tree commit diff
path: root/Src/Zle/zle_main.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-04-20 21:17:29 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-04-20 21:17:29 +0000
commitb8ec06c870ac09d5949907640dca4c1a2b711ed5 (patch)
treef5676d7f945f34fe69e30e67fa7fbc8a82730b94 /Src/Zle/zle_main.c
parenta12b1f35aaeff5724c1d7b4824de62cb4e480698 (diff)
downloadzsh-b8ec06c870ac09d5949907640dca4c1a2b711ed5.tar.gz
zsh-b8ec06c870ac09d5949907640dca4c1a2b711ed5.tar.xz
zsh-b8ec06c870ac09d5949907640dca4c1a2b711ed5.zip
24853: use metafied strings for inner loops over history
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r--Src/Zle/zle_main.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 713221d0d..280460f81 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -143,12 +143,10 @@ mod_export int lastcmd;
 /**/
 mod_export Widget compwidget;
 
-/* the status line, and its length */
+/* the status line, a null-terminated metafied string */
 
 /**/
-mod_export ZLE_STRING_T statusline;
-/**/
-mod_export int statusll;
+mod_export char *statusline;
 
 /* The current history line and cursor position for the top line *
  * on the buffer stack.                                          */
@@ -1240,12 +1238,16 @@ zleread(char **lp, char **rp, int flags, int context)
 int
 execzlefunc(Thingy func, char **args, int set_bindk)
 {
-    int r = 0, ret = 0;
+    int r = 0, ret = 0, remetafy = 0;
     Widget w;
     Thingy save_bindk = bindk;
 
     if (set_bindk)
 	bindk = func;
+    if (zlemetaline) {
+	unmetafy_line();
+	remetafy = 1;
+    }
 
     if(func->flags & DISABLED) {
 	/* this thingy is not the name of a widget */
@@ -1350,6 +1352,8 @@ execzlefunc(Thingy func, char **args, int set_bindk)
      * directly.
      */
     CCRIGHT();
+    if (remetafy)
+	metafy_line();
     return ret;
 }
 
@@ -1632,8 +1636,7 @@ describekeybriefly(UNUSED(char **args))
     if (statusline)
 	return 1;
     clearlist = 1;
-    statusline = ZWS("Describe key briefly: _");
-    statusll = ZS_strlen(statusline);
+    statusline = "Describe key briefly: _";
     zrefresh();
     seq = getkeymapcmd(curkeymap, &func, &str);
     statusline = NULL;