aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vis.c7
1 files 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;
}