about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2016-09-26 11:55:33 +0200
committerMikael Magnusson <mikachu@gmail.com>2016-09-30 10:48:20 +0200
commit5cf2ffb327faf84b73beb812ff2f7e9bf08e7ecf (patch)
tree08bf1973d3e17d7091735716f95eed35abfb8183
parent13d0b278be9f9f10655a53a88b863351d85b523d (diff)
downloadzsh-5cf2ffb327faf84b73beb812ff2f7e9bf08e7ecf.tar.gz
zsh-5cf2ffb327faf84b73beb812ff2f7e9bf08e7ecf.tar.xz
zsh-5cf2ffb327faf84b73beb812ff2f7e9bf08e7ecf.zip
Call the pre-redraw hook if there is text in the buffer on init
-rw-r--r--ChangeLog6
-rw-r--r--Src/Zle/zle_main.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8450407c8..b49289b63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-30  Mikael Magnusson  <mikachu@gmail.com>
+
+	* 39452 + comment from 39432: Src/Zle/zle_main.c: Call the
+	pre-redraw hook if there is text in the buffer on init (from
+	popping or zle-line-init setting $BUFFER)
+
 2016-09-30  Oliver Kiddle  <opk@zsh.org>
 
 	* 39514: Completion/Unix/Command/_git: handle --git-dir
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 9a83d4141..0bdd82ba4 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1162,7 +1162,16 @@ zlecore(void)
     popheap();
 }
 
-/* Read a line.  It is returned metafied. */
+/* Read a line.  It is returned metafied.
+ *
+ * Parameters:
+ * - lp: left prompt, e.g., $PS1
+ * - rp: right prompt, e.g., $RPS1
+ * - flags: ZLRF_* flags (I think), see zlereadflags
+ * - context: ZLCON_* flags (I think), see zlecontext
+ * - init: "zle-line-init"
+ * - finish: "zle-line-finish"
+ */
 
 /**/
 char *
@@ -1299,6 +1308,9 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
 
     zlecallhook(init, NULL);
 
+    if (zleline && *zleline)
+	redrawhook();
+
     if ((bracket = getaparam("zle_bracketed_paste")) && arrlen(bracket) == 2)
 	fputs(*bracket, shout);