From da0241ba3981d7fac30d388af3ecf728bc65ee02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 10 Feb 2017 18:45:21 +0100 Subject: vis: make t, T, f and F work for special keys Fix #491 --- main.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d84c7da..a576a44 100644 --- a/main.c +++ b/main.c @@ -1721,16 +1721,12 @@ static const char *movement_key(Vis *vis, const char *keys, const Arg *arg) { return NULL; } - char key[32]; - const char *next; - if (!(next = vis_keys_next(vis, keys))) + const char *next = vis_keys_next(vis, keys); + if (!next) return NULL; - size_t len = next - keys; - if (len < sizeof key) { - strncpy(key, keys, len); - key[len] = '\0'; - vis_motion(vis, arg->i, key); - } + char utf8[UTFmax+1]; + if (vis_keys_utf8(vis, keys, utf8)) + vis_motion(vis, arg->i, utf8); return next; } -- cgit v1.2.3