From d47c31e12e0e2aa691b861a0da884f785664ba36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 22 Dec 2014 15:07:27 +0100 Subject: Move kepress hook to record all keys --- vis.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vis.c b/vis.c index 6015fcb..e9eb7c8 100644 --- a/vis.c +++ b/vis.c @@ -1732,8 +1732,6 @@ static void keypress(Key *key) { static KeyCombo keys; static int keylen; - if (config->keypress && !config->keypress(key)) - return; keys[keylen++] = *key; KeyBinding *action = keybinding(mode, keys); @@ -1759,7 +1757,7 @@ static void keypress(Key *key) { } static Key getkey(void) { - Key key = { .str = "\0\0\0\0\0\0", .code = 0 }; + Key key = { .str = "", .code = 0 }; int keycode = getch(), len = 0; if (keycode == ERR) return key; @@ -1778,6 +1776,9 @@ static Key getkey(void) { } } + if (config->keypress && !config->keypress(&key)) + return (Key){ .str = "", .code = 0 }; + return key; } -- cgit v1.2.3