about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2006-01-28 15:02:25 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2006-01-28 15:02:25 +0000
commit4b3cdcdb696840c6af4a77cd37fed62df1f3a3e8 (patch)
tree63ca7569fa9bb21fad16493e0e95a7feae1bb4ae /Src
parente732e0b8a8c6fad3f7c3dda0b7a238a50518d984 (diff)
downloadzsh-4b3cdcdb696840c6af4a77cd37fed62df1f3a3e8.tar.gz
zsh-4b3cdcdb696840c6af4a77cd37fed62df1f3a3e8.tar.xz
zsh-4b3cdcdb696840c6af4a77cd37fed62df1f3a3e8.zip
22169: hook function zle-keymap-select called when $KEYMAP changes
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/zle_keymap.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/Src/Zle/zle_keymap.c b/Src/Zle/zle_keymap.c
index 7cd3b2365..7b1f9e1ad 100644
--- a/Src/Zle/zle_keymap.c
+++ b/Src/Zle/zle_keymap.c
@@ -400,8 +400,24 @@ selectkeymap(char *name, int fb)
 	km = openkeymap(name = ".safe");
     }
     if(name != curkeymapname) {
-	zsfree(curkeymapname);
+	char *oname = curkeymapname;
+	Thingy chgthingy;
+
 	curkeymapname = ztrdup(name);
+
+	if (oname && zleactive && strcmp(oname, curkeymapname) &&
+	    (chgthingy = rthingy_nocreate("zle-keymap-select"))) {
+	    char *args[2];
+	    int saverrflag = errflag, savretflag = retflag;
+	    args[0] = oname;
+	    args[1] = NULL;
+	    errflag = retflag = 0;
+	    execzlefunc(chgthingy, args);
+	    unrefthingy(chgthingy);
+	    errflag = saverrflag;
+	    retflag = savretflag;
+	}
+	zsfree(oname);
     }
     curkeymap = km;
     return 0;