about summary refs log tree commit diff
path: root/Src/Zle/zle_refresh.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_refresh.c')
-rw-r--r--Src/Zle/zle_refresh.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index 21e79ccb5..43b05484b 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1041,6 +1041,7 @@ zrefresh(void)
     }
 
     if ((initthingy = rthingy_nocreate("zle-line-pre-redraw"))) {
+	int lastcmd_prev = lastcmd;
 	char *args[2];
 	Thingy lbindk_save = lbindk, bindk_save = bindk;
 	refthingy(lbindk_save);
@@ -1055,6 +1056,9 @@ zrefresh(void)
 	unrefthingy(bindk);
 	lbindk = lbindk_save;
 	bindk = bindk_save;
+	/* we can't set ZLE_NOTCOMMAND since it's not a legit widget, so
+	 * restore lastcmd manually so that we don't mess up the global state */
+	lastcmd = lastcmd_prev;
     }
 
     /* this will create region_highlights if it's still NULL */