diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-04 10:51:10 +0200 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-17 00:38:58 +0200 |
| commit | 01f3d7cbda4b9667fd2e65c6786a0e9140e2890b (patch) | |
| tree | 9e1cef9e2aff9603208eb70174f2b54aeb2dd657 /src/client.cc | |
| parent | 31e9fc3cefcbea03d4eaad75ed0dab3da8f3dc6f (diff) | |
Rename key_to_str() to the more idiomatic to_string()
This makes the function easier to find for newcomers because
to_string() is the obvious name. It enables format() to do the
conversion automatically which seems like good idea (since there is
no other obvious representation).
Of course this change makes it a bit harder to grep but that's not
a problem with clang tooling.
We need to cast the function in one place when calling transform()
but that's acceptable.
Diffstat (limited to 'src/client.cc')
| -rw-r--r-- | src/client.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client.cc b/src/client.cc index 09a39288..27f0fbaa 100644 --- a/src/client.cc +++ b/src/client.cc @@ -92,8 +92,7 @@ bool Client::process_pending_inputs() try { if (debug_keys) - write_to_debug_buffer(format("Client '{}' got key '{}'", - context().name(), key_to_str(key))); + write_to_debug_buffer(format("Client '{}' got key '{}'", context().name(), key)); if (key == Key::FocusIn) context().hooks().run_hook(Hook::FocusIn, context().name(), context()); @@ -102,7 +101,7 @@ bool Client::process_pending_inputs() else m_input_handler.handle_key(key); - context().hooks().run_hook(Hook::RawKey, key_to_str(key), context()); + context().hooks().run_hook(Hook::RawKey, to_string(key), context()); } catch (Kakoune::runtime_error& error) { @@ -327,7 +326,7 @@ void Client::on_buffer_reload_key(Key key) } else { - print_status({ format("'{}' is not a valid choice", key_to_str(key)), + print_status({ format("'{}' is not a valid choice", key), context().faces()["Error"] }); m_input_handler.on_next_key("buffer-reload", KeymapMode::None, [this](Key key, Context&){ on_buffer_reload_key(key); }); return; |
