From 0814bb29627297a7d7fce8431e31b7ba84e8a0b0 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 21 Dec 2017 10:30:45 +1100 Subject: [PATCH] InputHandler: Preserve no-hooks on insert mode from single command normal mode Fixes #1775 --- src/input_handler.cc | 5 +++++ 1 file changed, 5 insertions(+) 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()}, + 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; }; }