1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 17:24:50 +01:00

add zle-line-pre-redraw

Go to some lengths to preserve $LASTWIDGET in pre-redraw
means we can't use the callzlehook function

has same workaround as 29643
This commit is contained in:
Mikael Magnusson 2009-11-29 11:07:12 +01:00
parent 50721a1986
commit 9b07c6fe5a

View file

@ -994,6 +994,7 @@ zrefresh(void)
int remetafy; /* flag that zle line is metafied */ int remetafy; /* flag that zle line is metafied */
int txtchange; /* attributes set after prompts */ int txtchange; /* attributes set after prompts */
int rprompt_off = 1; /* Offset of rprompt from right of screen */ int rprompt_off = 1; /* Offset of rprompt from right of screen */
int old_incompfunc = incompfunc;
struct rparams rpms; struct rparams rpms;
#ifdef MULTIBYTE_SUPPORT #ifdef MULTIBYTE_SUPPORT
int width; /* width of wide character */ int width; /* width of wide character */
@ -1039,6 +1040,23 @@ zrefresh(void)
tmpalloced = 0; tmpalloced = 0;
} }
if ((initthingy = rthingy_nocreate("zle-line-pre-redraw"))) {
char *args[2];
Thingy lbindk_save = lbindk, bindk_save = bindk;
refthingy(lbindk_save);
refthingy(bindk_save);
args[0] = initthingy->nam;
args[1] = NULL;
incompfunc = 0;
execzlefunc(initthingy, args, 0);
incompfunc = old_incompfunc;
unrefthingy(initthingy);
unrefthingy(lbindk);
unrefthingy(bindk);
lbindk = lbindk_save;
bindk = bindk_save;
}
/* this will create region_highlights if it's still NULL */ /* this will create region_highlights if it's still NULL */
zle_set_highlight(); zle_set_highlight();