summaryrefslogtreecommitdiff
path: root/src/input_handler.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-11-11 21:38:40 +1100
committerMaxime Coste <mawww@kakoune.org>2019-11-11 21:47:47 +1100
commit5060a4733acbeb68396ee20ae7a6b8bb89020516 (patch)
tree778d2929938fd290ddba8ca8e03da2e4b0bb1732 /src/input_handler.hh
parent7438f23b9beddc42b6561fe8be3f953aff2f73b1 (diff)
Add mode information to next-key mode name
Currently expose an additional name, the format is up for discussion. Fixes #1855 Fixes #2569 Fixes #2672
Diffstat (limited to 'src/input_handler.hh')
-rw-r--r--src/input_handler.hh7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/input_handler.hh b/src/input_handler.hh
index 62c8ca65..3638785b 100644
--- a/src/input_handler.hh
+++ b/src/input_handler.hh
@@ -80,7 +80,7 @@ public:
// execute callback on next keypress and returns to normal mode
// if callback does not change the mode itself
- void on_next_key(KeymapMode mode, KeyCallback callback);
+ void on_next_key(StringView mode_name, KeymapMode mode, KeyCallback callback);
// process the given key
void handle_key(Key key);
@@ -175,11 +175,12 @@ bool show_auto_info_ifn(StringView title, StringView info, AutoInfo mask, const
void hide_auto_info_ifn(const Context& context, bool hide);
template<typename Cmd>
-void on_next_key_with_autoinfo(const Context& context, KeymapMode keymap_mode, Cmd cmd,
+void on_next_key_with_autoinfo(const Context& context, StringView mode_name,
+ KeymapMode keymap_mode, Cmd cmd,
StringView title, StringView info)
{
const bool hide = show_auto_info_ifn(title, info, AutoInfo::OnKey, context);
- context.input_handler().on_next_key(
+ context.input_handler().on_next_key(mode_name,
keymap_mode, [hide,cmd](Key key, Context& context) mutable {
hide_auto_info_ifn(context, hide);
cmd(key, context);