Do not reset edition level to 0 on buffer change

Keep it as is, commit undo in current buffer, and we will commit it in
the new buffer when edition level gets back to 0.
This commit is contained in:
Maxime Coste 2014-11-21 18:56:39 +00:00
parent 669b955bac
commit e8c8833211
2 changed files with 2 additions and 10 deletions

View File

@ -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);

View File

@ -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: