From a36d7ab99b4a5b1c10bc68828942faf69c35c0d0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Mon, 31 Aug 2015 08:35:23 +0200 Subject: Fix paste highlighting with zle-line-pre-redraw --- Src/Zle/zle_refresh.c | 4 ++++ 1 file changed, 4 insertions(+) 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 */ -- cgit 1.4.1