From a1881512f3050e8d6719a28b55846c1f4c93acab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 13 May 2016 23:13:52 +0200 Subject: vis: clean up key mapping implementation --- vis-lua.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'vis-lua.c') 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); -- cgit v1.2.3