summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-10-17 11:29:52 +0800
committerMaxime Coste <mawww@kakoune.org>2017-10-20 12:21:22 +0800
commitddff35e5ab6a9bed29c49547eaee91637854f029 (patch)
treeb6059182aac4aa418fa9d5d7628ba67efa34839b /src/input_handler.cc
parent209113aa1c37464687612520542795900d461215 (diff)
Move keymap as an implementation detail of the normal mode keys
Only expose a free function that tries to get the NormalCmd from a key.
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index d4214ed1..25ceacc3 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -281,19 +281,18 @@ public:
context().client().info_hide();
do_restore_hooks = true;
- auto it = keymap.find(key);
- if (it != keymap.end() and it->key == key)
+ if (auto command = get_normal_command(key))
{
auto autoinfo = context().options()["autoinfo"].get<AutoInfo>();
if (autoinfo & AutoInfo::Normal and context().has_client())
- context().client().info_show(key_to_str(key), it->value.docstring.str(),
+ context().client().info_show(key_to_str(key), command->docstring.str(),
{}, InfoStyle::Prompt);
// reset m_params now to be reentrant
NormalParams params = m_params;
m_params = { 0, 0 };
- it->value.func(context(), params);
+ command->func(context(), params);
}
}