@@ -1025,6 +1025,31 @@ getrestchar(int inchar, char *outstr, int *outcount)
1025
1025
/**/
1026
1026
#endif
1027
1027
1028
+ static void redrawhook ()
1029
+ {
1030
+ Thingy initthingy ;
1031
+ if ((initthingy = rthingy_nocreate ("zle-line-pre-redraw" ))) {
1032
+ int lastcmd_prev = lastcmd ;
1033
+ int old_incompfunc = incompfunc ;
1034
+ char * args [2 ];
1035
+ Thingy lbindk_save = lbindk , bindk_save = bindk ;
1036
+ refthingy (lbindk_save );
1037
+ refthingy (bindk_save );
1038
+ args [0 ] = initthingy -> nam ;
1039
+ args [1 ] = NULL ;
1040
+ incompfunc = 0 ;
1041
+ execzlefunc (initthingy , args , 0 );
1042
+ incompfunc = old_incompfunc ;
1043
+ unrefthingy (initthingy );
1044
+ unrefthingy (lbindk );
1045
+ unrefthingy (bindk );
1046
+ lbindk = lbindk_save ;
1047
+ bindk = bindk_save ;
1048
+ /* we can't set ZLE_NOTCOMMAND since it's not a legit widget, so
1049
+ * restore lastcmd manually so that we don't mess up the global state */
1050
+ lastcmd = lastcmd_prev ;
1051
+ }
1052
+ }
1028
1053
1029
1054
/**/
1030
1055
void
@@ -1085,28 +1110,7 @@ zlecore(void)
1085
1110
break ;
1086
1111
}
1087
1112
1088
- Thingy initthingy ;
1089
- if ((initthingy = rthingy_nocreate ("zle-line-pre-redraw" ))) {
1090
- int lastcmd_prev = lastcmd ;
1091
- int old_incompfunc = incompfunc ;
1092
- char * args [2 ];
1093
- Thingy lbindk_save = lbindk , bindk_save = bindk ;
1094
- refthingy (lbindk_save );
1095
- refthingy (bindk_save );
1096
- args [0 ] = initthingy -> nam ;
1097
- args [1 ] = NULL ;
1098
- incompfunc = 0 ;
1099
- execzlefunc (initthingy , args , 0 );
1100
- incompfunc = old_incompfunc ;
1101
- unrefthingy (initthingy );
1102
- unrefthingy (lbindk );
1103
- unrefthingy (bindk );
1104
- lbindk = lbindk_save ;
1105
- bindk = bindk_save ;
1106
- /* we can't set ZLE_NOTCOMMAND since it's not a legit widget, so
1107
- * restore lastcmd manually so that we don't mess up the global state */
1108
- lastcmd = lastcmd_prev ;
1109
- }
1113
+ redrawhook ();
1110
1114
#ifdef HAVE_POLL
1111
1115
if (baud && !(lastcmd & ZLE_MENUCMP )) {
1112
1116
struct pollfd pfd ;
@@ -1818,6 +1822,7 @@ recursiveedit(UNUSED(char **args))
1818
1822
{
1819
1823
int locerror ;
1820
1824
1825
+ redrawhook ();
1821
1826
zrefresh ();
1822
1827
zlecore ();
1823
1828
0 commit comments