summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-07-17 19:59:18 +1000
committerMaxime Coste <mawww@kakoune.org>2024-07-17 20:00:13 +1000
commit12deb7d5dad2a0703d0f6e2f683a4c32f6ff7ae3 (patch)
treeee2f11c0380c8003e38d6bac472d78fe509e07cb /src/input_handler.cc
parente3ffa05ff05e8d43d713ff1e5f82ea748dba3721 (diff)
Clear info box and prompt on paste
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 99fb684e..eb809b5f 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -23,6 +23,13 @@
namespace Kakoune
{
+static void clear_info_and_echo(Context& context)
+{
+ context.print_status({});
+ if (context.has_client())
+ context.client().info_hide();
+}
+
class InputMode : public RefCountable
{
public:
@@ -97,6 +104,8 @@ void InputMode::paste(StringView content)
context().print_status({error.what().str(), context().faces()["Error"] });
context().hooks().run_hook(Hook::RuntimeError, error.what(), context());
}
+
+ clear_info_and_echo(context());
}
namespace InputModes
@@ -285,9 +294,7 @@ public:
if (m_mouse_handler.handle_key(key, context()))
{
- context().print_status({});
- if (context().has_client())
- context().client().info_hide();
+ clear_info_and_echo(context());
if (not transient)
m_idle_timer.set_next_date(Clock::now() + get_idle_timeout(context()));
@@ -334,9 +341,7 @@ public:
m_state = State::PopOnEnabled;
});
- context().print_status({});
- if (context().has_client())
- context().client().info_hide();
+ clear_info_and_echo(context());
// Hack to parse keys sent by terminals using the 8th bit to mark the
// meta key. In normal mode, give priority to a potential alt-key than