From 70bb4847ee57ce50a1e763766f83e6072240ee33 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 21 Dec 2011 18:57:07 +0000 Subject: [PATCH] IncrementalInserter: catch exception thrown by the hook --- src/window.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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(); }