From 031b26584bf4afd40f19b690d0c2bde2585b6e63 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 9 Apr 2022 13:48:03 -0700 Subject: [PATCH] Revert "input.cpp: remove unused describe_char()" This reverts commit 99cfca8498941fc51ae16b18802706fb8608757f. describe_char is quite useful for debugging. --- src/input.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/input.cpp b/src/input.cpp index bab05c997..4ead777f0 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -173,6 +173,13 @@ static_assert(sizeof(input_function_metadata) / sizeof(input_function_metadata[0 "input_function_metadata size mismatch with input_common. Did you forget to update " "input_function_metadata?"); +wcstring describe_char(wint_t c) { + if (c < R_END_INPUT_FUNCTIONS) { + return format_string(L"%02x (%ls)", c, input_function_metadata[c].name); + } + return format_string(L"%02x", c); +} + using mapping_list_t = std::vector; input_mapping_set_t::input_mapping_set_t() = default; input_mapping_set_t::~input_mapping_set_t() = default; @@ -690,7 +697,7 @@ void inputter_t::mapping_execute_matching_or_generic(const command_handler_t &co } FLOGF(reader, L"no generic found, ignoring char..."); - peeker.next(); + auto evt = peeker.next(); peeker.consume(); }