Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Re: Bug: Callback to widget set with `zle -Fw <widget>` shouldn't change $LASTWIDGET
- X-seq: zsh-workers 51310
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] Re: Bug: Callback to widget set with `zle -Fw <widget>` shouldn't change $LASTWIDGET
- Date: Mon, 16 Jan 2023 16:01:42 -0800
- Archived-at: <https://zsh.org/workers/51310>
- In-reply-to: <CAHLkEDuuosi7udHsQ9uaBRcv5poEUU_i1iSRGgEXFbtBkzHQOQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDuuosi7udHsQ9uaBRcv5poEUU_i1iSRGgEXFbtBkzHQOQ@mail.gmail.com>
Is this good enough, or is there a need to consider that the handler
might delete the previous last widget? What does/should happen in
that case (or when a widget deletes itself, for that matter)?
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index 686c6f5b4..cfa0a739d 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -737,6 +737,7 @@ raw_getbyte(long do_keytmout, char *cptr, int full)
) {
/* Handle the fd. */
char *fdbuf;
+ Thingy save_lbindk = lbindk;
{
char buf[BDIGBUFSIZE];
convbase(buf, lwatch_fd->fd, 10);
@@ -779,6 +780,7 @@ raw_getbyte(long do_keytmout, char *cptr, int full)
*/
errtry = 1;
}
+ lbindk = save_lbindk;
}
}
/* Function may have invalidated the display. */
Messages sorted by:
Reverse Date,
Date,
Thread,
Author