about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-07-04 10:13:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-07-04 10:13:38 +0000
commit76c1e267133ac66148c61b221041af2dbef89858 (patch)
tree41bba7d99143e268b5308ff19ef657345cce88aa
parentc2dd10edc9136f11746b7cbedf5801106a2e0541 (diff)
downloadzsh-76c1e267133ac66148c61b221041af2dbef89858.tar.gz
zsh-76c1e267133ac66148c61b221041af2dbef89858.tar.xz
zsh-76c1e267133ac66148c61b221041af2dbef89858.zip
17405: adapt 17390 to reset PREDISPLAY and POSTDISPLAY when zle is entered
-rw-r--r--ChangeLog6
-rw-r--r--Doc/Zsh/zle.yo10
-rw-r--r--Src/Zle/zle_main.c1
-rw-r--r--Src/Zle/zle_params.c10
4 files changed, 21 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 8a61dc027..7c33de05a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-04  Peter Stephenson  <pws@csr.com>
+
+	* 17405: Src/Zle/zle_main.c, Src/Zle/zle_params.c, Doc/Zsh/zle.yo:
+	adapt 17390 so that PREDISPLAY and POSTDISPLAY are reset when zle
+	is entered.
+
 2002-07-04  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 17403: Src/Zle/compcore.c, Src/Zle/complete.c,
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 8022a1bdd..d1e68a238 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -666,17 +666,15 @@ vindex(PREDISPLAY)
 item(tt(PREDISPLAY) (scalar))(
 Text to be displayed before the start of the editable text buffer.  This
 does not have to be a complete line; to display a complete line, a newline
-must be appended explicitly.  Note that the text survives between calls to zle
-and hence must be removed explicitly by assigning an empty value to the
-parameter.
+must be appended explicitly.    The text is reset on each new invocation
+(but not recursive invocation) of zle.
 )
 vindex(POSTDISPLAY)
 item(tt(POSTDISPLAY) (scalar))(
 Text to be displayed after the end of the editable text buffer.  This
 does not have to be a complete line; to display a complete line, a newline
-must be prepended explicitly.  Note that the text survives between calls to
-zle and hence must be removed explicitly by assigning an empty value to the
-parameter.
+must be prepended explicitly.  The text is reset on each new invocation
+(but not recursive invocation) of zle.
 )
 vindex(RBUFFER)
 item(tt(RBUFFER) (scalar))(
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 9332b509d..1ec0171bb 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -752,6 +752,7 @@ zleread(char *lp, char *rp, int flags)
     pmpt_attr = txtchange;
     rpromptbuf = promptexpand(rp, 1, NULL, NULL);
     rpmpt_attr = txtchange;
+    free_prepostdisplay();
 
     zlereadflags = flags;
     histline = curhist;
diff --git a/Src/Zle/zle_params.c b/Src/Zle/zle_params.c
index ef8a98139..1987974d2 100644
--- a/Src/Zle/zle_params.c
+++ b/Src/Zle/zle_params.c
@@ -516,3 +516,13 @@ get_postdisplay(Param pm)
 {
     return get_prepost(postdisplay, postdisplaylen);
 }
+
+/**/
+void
+free_prepostdisplay(void)
+{
+    if (predisplaylen)
+	set_prepost(&predisplay, &predisplaylen, NULL);
+    if (postdisplaylen)
+	set_prepost(&postdisplay, &postdisplaylen, NULL);
+}