aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-13 23:13:52 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-13 23:13:52 +0200
commita1881512f3050e8d6719a28b55846c1f4c93acab (patch)
treedc825eecd6bff16a2ca4b76cf48c8f0a5c0090d3 /vis-lua.c
parent9a9f7a96f5b02777b8c0823cffd173a72ca3e3c2 (diff)
downloadvis-a1881512f3050e8d6719a28b55846c1f4c93acab.tar.gz
vis-a1881512f3050e8d6719a28b55846c1f4c93acab.tar.xz
vis: clean up key mapping implementation
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/vis-lua.c b/vis-lua.c
index a5a28d8..18259ef 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -410,21 +410,7 @@ 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))
+ if (!vis_mode_map(vis, mode, true, key, binding))
goto err;
lua_pushboolean(L, true);