aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 9df2a8e..0096a4f 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -403,6 +403,20 @@ static int map(lua_State *L) {
binding->action = action;
+ char *lhs = strdup(key), *next = lhs;
+ while (next) {
+ char tmp;
+ next = (char*)vis_keys_next(vis, next);
+ if (next) {
+ tmp = *next;
+ *next = '\0';
+ }
+ vis_mode_unmap(vis, mode, lhs);
+ if (next)
+ *next = tmp;
+ }
+ free(lhs);
+
if (!vis_mode_map(vis, mode, key, binding))
goto err;