Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] zle: Call zle-line-pre-redraw when popping from bufstack.
- X-seq: zsh-workers 39432
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] zle: Call zle-line-pre-redraw when popping from bufstack.
- Date: Sun, 25 Sep 2016 13:25:05 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=znGzC8UdtmQFCr6qTSmJaDLDPBQ=; b=GCicFz HGWu88DiTfC+v6WOzcSdcDBByIRtreXtt2236UxNcEH1hLDEeMaKZmuvfin7Ma52 VrxrFaDJ4YNgSIn2ag8m506mppq+iw7V1gtWZ5UF+GPcrs1YO/tZWrO2kxlilufF DRyg3F6tNqawRz8JZUxXVSU92EV+MWdjD5KVY=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-sasl-enc:x-sasl-enc; s=smtpout; bh=znGzC8UdtmQFCr6qTSmJaDLDPB Q=; b=MwMyUgYmcYygbItU4DpvLTPKaC1KQLPlqDz3ZdgZXNDjfERDOOOqhSp7oo Ot8DIj5dYmBSdv6R3WE+ul+tgWOAbXIRrMZpTz3B/Og9wIm4FQqTJqF6lXFPdQIg zeycq1PZuoeshLVQcp3CM+BNP4ajzO8AjfSWyibnejF26754w=
- 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
---
I'd appreciate another pair of eyes; it looks correct but I'm not very
familiar with this part of the code.
Originally reported as <https://github.com/zsh-users/zsh-syntax-highlighting/issues/40>.
Thanks,
Daniel
Src/Zle/zle_main.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 9a83d41..89a545b 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.
+ *
+ * Parmaeters:
+ * - 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 *
@@ -1171,6 +1180,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
char *s, **bracket;
int old_errno = errno;
int tmout = getiparam("TMOUT");
+ int redraw_required = 0;
#if defined(HAVE_POLL) || defined(HAVE_SELECT)
/* may not be set, but that's OK since getiparam() returns 0 == off */
@@ -1242,6 +1252,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
initundo();
fixsuffix();
if ((s = getlinknode(bufstack))) {
+ redraw_required = 1;
setline(s, ZSL_TOEND);
zsfree(s);
if (stackcs != -1) {
@@ -1293,6 +1304,12 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish)
prefixflag = 0;
region_active = 0;
+ if (redraw_required) {
+ /* If we popped a command from bufstack, syntax highlight it, now
+ * that zle is active. */
+ redrawhook();
+ }
+
zrefresh();
unqueue_signals(); /* Should now be safe to acknowledge SIGWINCH */
Messages sorted by:
Reverse Date,
Date,
Thread,
Author