Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Call the pre-redraw hook if there is text in the buffer on init



[ As it turns out, the reason Daniel's patch didn't work for me was a
problem in my hook function, it just did an early return for optimization
based on how many times it was called since the last accept-line,
and that was off by one when popping the buffer apparently, I've just
removed that check now.

If you want to commit your comment at the top, there's a typo for Parmaeters. ]

Either way, I think this approach might be better. It will highlight
any text that may also have been added by the zle-line-init hook, in
addition to also highlighting popped text.

---
 Src/Zle/zle_main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 90e38042be..7a3cf249cf 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -1299,6 +1299,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);
 
-- 
2.8.2



Messages sorted by: Reverse Date, Date, Thread, Author