summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-12-21 10:30:45 +1100
committerMaxime Coste <mawww@kakoune.org>2017-12-21 10:30:45 +1100
commit0814bb29627297a7d7fce8431e31b7ba84e8a0b0 (patch)
tree7eafba77ddd5836a9394877b7cf7b74e0b30d217 /src/input_handler.cc
parente0b28fa421105efa25e0e1aeb78bc83cca32ee1e (diff)
InputHandler: Preserve no-hooks on insert mode from single command normal mode
Fixes #1775
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 4915e0ee..7c1c1d9f 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -281,6 +281,9 @@ public:
}
else
{
+ // Preserve hooks disabled for the whole execution prior to pop_mode
+ ScopedSetBool disable_hooks{context().hooks_disabled(),
+ m_single_command and m_hooks_disabled};
if (m_single_command)
pop_mode();
@@ -1050,6 +1053,7 @@ public:
m_edition(context()),
m_completer(context()),
m_autoshowcompl{context().options()["autoshowcompl"].get<bool>()},
+ m_disable_hooks{context().hooks_disabled(), context().hooks_disabled()},
m_idle_timer{TimePoint::max(), context().flags() & Context::Flags::Transient ?
Timer::Callback{} : [this](Timer&) {
if (m_autoshowcompl)
@@ -1392,6 +1396,7 @@ private:
Timer m_idle_timer;
bool m_in_end = false;
MouseHandler m_mouse_handler;
+ ScopedSetBool m_disable_hooks;
};
}