mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-29 10:02:57 +03:00
Do not allow exiting insert mode while running InsertEnd hook.
Fixes #311
This commit is contained in:
parent
123541822b
commit
883a14e853
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user