diff --git a/src/window.cc b/src/window.cc index 6f84097b..725d31d3 100644 --- a/src/window.cc +++ b/src/window.cc @@ -455,12 +455,16 @@ IncrementalInserter::IncrementalInserter(Window& window, Mode mode) IncrementalInserter::~IncrementalInserter() { - HooksManager::instance().run_hook("WinInsertEnd", "", Context(m_window)); - move_cursor(DisplayCoord(0, -1)); + + try + { + HooksManager::instance().run_hook("WinInsertEnd", "", Context(m_window)); + } + catch (runtime_error& e) {} + assert(m_window.m_current_inserter == this); m_window.m_current_inserter = nullptr; - m_window.m_buffer.end_undo_group(); }