diff --git a/src/context.cc b/src/context.cc index 4c72c2bf..b88400dc 100644 --- a/src/context.cc +++ b/src/context.cc @@ -177,10 +177,8 @@ void Context::change_buffer(Buffer& buffer) return; if (m_edition_level > 0) - { this->buffer().commit_undo_group(); - m_edition_level = 0; - } + m_window.reset(); if (has_client()) client().change_buffer(buffer); diff --git a/src/context.hh b/src/context.hh index cd7abb23..b7ec94e4 100644 --- a/src/context.hh +++ b/src/context.hh @@ -121,13 +121,7 @@ struct ScopedEdition : m_context(context), m_buffer(&context.buffer()) { m_context.begin_edition(); } - ~ScopedEdition() - { - // If buffer changed, the edition count - // was reset. - if (m_buffer == &m_context.buffer()) - m_context.end_edition(); - } + ~ScopedEdition() { m_context.end_edition(); } Context& context() const { return m_context; } private: