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
- X-seq: zsh-workers 39452
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: Call the pre-redraw hook if there is text in the buffer on init
- Date: Mon, 26 Sep 2016 11:59:34 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=tUwsn3j90lcJuPMEWiA0uqEspfuQWg+pQgsZtI01iLo=; b=E7GcV2W3+d4OKWHG47uiStzRlr+Ytak6RTLxmtA7taqhM+NzBG4bL8q/kMLaKFtEZA o+69IJuwRVuelYYO4M+0K1UYewcYMStQv8E0mefJhk9eMjTls+Uyz2i5Gvb9/FSa95fi mgWI5e8n1aj4n4Z+ttmdMvXIXVa+v8BhE7iolTOVxX72nZgEOBg3QJ4bf5NlOeo/VuV2 mIJKDybW3M0V3MgPol4f9vqHQyYNHSk94ybCmZexRUHomdnP40wm9Mu209GLfTZEM0Wg AY6yDwiCXR9B6GyGXUQkuA3DUM81YI9STRMNRB2LHcygWfqNlWhKVoMCoz33XzjNB4dI sxNA==
- In-reply-to: <1474809905-12861-1-git-send-email-danielsh@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1474809905-12861-1-git-send-email-danielsh@fujitsu.shahaf.local2>
[ 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