diff options
Diffstat (limited to 'src/nvim/keymap.c')
-rw-r--r-- | src/nvim/keymap.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/keymap.c b/src/nvim/keymap.c index 2d117b5308..eab65f2625 100644 --- a/src/nvim/keymap.c +++ b/src/nvim/keymap.c @@ -940,3 +940,14 @@ char_u *replace_termcodes(const char_u *from, const size_t from_len, return *bufp; } +/// Logs a single key as a human-readable keycode. +void log_key(int log_level, int key) +{ + if (log_level < MIN_LOG_LEVEL) { + return; + } + char *keyname = key == K_EVENT + ? "K_EVENT" + : (char *)get_special_key_name(key, mod_mask); + LOG(log_level, "input: %s", keyname); +} |