summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-06-25 07:25:31 +0100
committerMaxime Coste <mawww@kakoune.org>2017-06-25 07:25:31 +0100
commit8a2ece78b724564fc972c349b6fe4f9dcf0b15d5 (patch)
tree85cd0043c728fefd4a27657d3dda370aa03a2633 /src/input_handler.cc
parent718adc9c885339cc7c6501b51a79800f21cab492 (diff)
Remember count when repeating last insert
Fixes #1465
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 1ac60905..217f3a5c 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -1057,6 +1057,7 @@ public:
last_insert().mode = mode;
last_insert().keys.clear();
last_insert().disable_hooks = context().hooks_disabled();
+ last_insert().count = count;
context().hooks().run_hook("InsertBegin", "", context());
prepare(mode, count);
@@ -1435,7 +1436,7 @@ void InputHandler::repeat_last_insert()
m_last_insert.disable_hooks);
// context.last_insert will be refilled by the new Insert
// this is very inefficient.
- push_mode(new InputModes::Insert(*this, m_last_insert.mode, 1));
+ push_mode(new InputModes::Insert(*this, m_last_insert.mode, m_last_insert.count));
for (auto& key : keys)
current_mode().handle_key(key);
kak_assert(dynamic_cast<InputModes::Normal*>(&current_mode()) != nullptr);