summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2022-08-04 10:51:10 +0200
committerJohannes Altmanninger <aclopte@gmail.com>2022-08-17 00:38:58 +0200
commit01f3d7cbda4b9667fd2e65c6786a0e9140e2890b (patch)
tree9e1cef9e2aff9603208eb70174f2b54aeb2dd657 /src/input_handler.cc
parent31e9fc3cefcbea03d4eaad75ed0dab3da8f3dc6f (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/input_handler.cc')
-rw-r--r--src/input_handler.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 956c32d7..bf2e5a4b 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -310,7 +310,7 @@ public:
{
auto autoinfo = context().options()["autoinfo"].get<AutoInfo>();
if (autoinfo & AutoInfo::Normal and context().has_client())
- context().client().info_show(key_to_str(key), command->docstring.str(),
+ context().client().info_show(to_string(key), command->docstring.str(),
{}, InfoStyle::Prompt);
// reset m_params now to be reentrant
@@ -323,7 +323,7 @@ public:
m_params = { 0, 0 };
}
- context().hooks().run_hook(Hook::NormalKey, key_to_str(key), context());
+ context().hooks().run_hook(Hook::NormalKey, to_string(key), context());
if (enabled() and not transient) // The hook might have changed mode
m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context()));
}
@@ -1403,7 +1403,7 @@ public:
if (auto cp = get_raw_codepoint(key))
{
insert(*cp);
- context().hooks().run_hook(Hook::InsertKey, key_to_str(key), context());
+ context().hooks().run_hook(Hook::InsertKey, to_string(key), context());
if (enabled() and not transient)
m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context()));
}
@@ -1416,9 +1416,9 @@ public:
return;
}
- context().hooks().run_hook(Hook::InsertKey, key_to_str(key), context());
+ context().hooks().run_hook(Hook::InsertKey, to_string(key), context());
if (moved)
- context().hooks().run_hook(Hook::InsertMove, key_to_str(key), context());
+ context().hooks().run_hook(Hook::InsertMove, to_string(key), context());
if (update_completions and enabled() and not transient) // Hooks might have disabled us
m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context()));
@@ -1723,7 +1723,7 @@ void InputHandler::handle_key(Key key)
// do not record the key that made us enter or leave recording mode,
// and the ones that are triggered recursively by previous keys.
if (was_recording and is_recording() and m_handle_key_level == m_recording_level)
- m_recorded_keys += key_to_str(key);
+ m_recorded_keys += to_string(key);
if (m_handle_key_level < m_recording_level)
{