1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-25 21:16:38 +03:00

Do not allow exiting insert mode while running InsertEnd hook.

Fixes #311
This commit is contained in:
Maxime Coste 2015-07-08 13:52:41 +01:00
parent 123541822b
commit 883a14e853

View File

@ -956,7 +956,11 @@ public:
bool moved = false; bool moved = false;
if (key == Key::Escape or key == ctrl('c')) if (key == Key::Escape or key == ctrl('c'))
{ {
if (m_in_end)
throw runtime_error("Asked to exit insert mode while running InsertEnd hook");
m_in_end = true;
context().hooks().run_hook("InsertEnd", "", context()); context().hooks().run_hook("InsertEnd", "", context());
m_completer.reset(); m_completer.reset();
pop_mode(keep_alive); pop_mode(keep_alive);
} }
@ -1175,6 +1179,7 @@ private:
bool m_autoshowcompl; bool m_autoshowcompl;
Timer m_idle_timer; Timer m_idle_timer;
bool m_disable_hooks; bool m_disable_hooks;
bool m_in_end = false;
}; };
} }