summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-06-27 09:57:10 +0100
committerMaxime Coste <mawww@kakoune.org>2017-06-27 09:57:10 +0100
commit641acc59433f73e6bc64f9d04e98deae7d7c5ffc (patch)
tree66295e3a217fc1e101f022dbf5c1fc2cb92c23d7 /src/input_handler.cc
parentce8078ad7386fc7dc23d2e5e191932403b2388cc (diff)
Do not allow repeating last insert when we are not in normal mode
<a-;>. is not accepted anymore. Note that <a-;> are not repeatable currently anyway (That could be fixed, athough not trivial). Fixes #1469
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 217f3a5c..2a14fc71 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -1430,6 +1430,9 @@ void InputHandler::repeat_last_insert()
if (m_last_insert.keys.empty())
return;
+ if (dynamic_cast<InputModes::Normal*>(&current_mode()) == nullptr)
+ throw runtime_error{"repeating last insert not available in this context"};
+
Vector<Key> keys;
swap(keys, m_last_insert.keys);
ScopedSetBool disable_hooks(context().hooks_disabled(),