about summary refs log tree commit diff
path: root/Src/Zle/zle_thingy.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_thingy.c')
-rw-r--r--Src/Zle/zle_thingy.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Src/Zle/zle_thingy.c b/Src/Zle/zle_thingy.c
index c0c8622b2..209949df2 100644
--- a/Src/Zle/zle_thingy.c
+++ b/Src/Zle/zle_thingy.c
@@ -639,9 +639,9 @@ zle_usable()
 static int
 bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 {
-    Thingy t;
+    Thingy t, savbindk = bindk;
     struct modifier modsave = zmod;
-    int ret, saveflag = 0;
+    int ret, saveflag = 0, setbindk = 0;
     char *wname = *args++, *keymap_restore = NULL, *keymap_tmp;
 
     if (!wname)
@@ -692,6 +692,9 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
 		if (selectkeymap(keymap_tmp, 0))
 		    return 1;
 		break;
+	    case 'w':
+		setbindk = 1;
+		break;
 	    default:
 		zwarnnam(name, "unknown option: %s", *args, 0);
 		return 1;
@@ -701,7 +704,10 @@ bin_zle_call(char *name, char **args, UNUSED(Options ops), UNUSED(char func))
     }
 
     t = rthingy(wname);
+    if (setbindk)
+	bindk = t;
     ret = execzlefunc(t, args);
+    bindk = savbindk;
     unrefthingy(t);
     if (saveflag)
 	zmod = modsave;