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:
parent
669b955bac
commit
e8c8833211
|
@ -177,10 +177,8 @@ void Context::change_buffer(Buffer& buffer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_edition_level > 0)
|
if (m_edition_level > 0)
|
||||||
{
|
|
||||||
this->buffer().commit_undo_group();
|
this->buffer().commit_undo_group();
|
||||||
m_edition_level = 0;
|
|
||||||
}
|
|
||||||
m_window.reset();
|
m_window.reset();
|
||||||
if (has_client())
|
if (has_client())
|
||||||
client().change_buffer(buffer);
|
client().change_buffer(buffer);
|
||||||
|
|
|
@ -121,13 +121,7 @@ struct ScopedEdition
|
||||||
: m_context(context), m_buffer(&context.buffer())
|
: m_context(context), m_buffer(&context.buffer())
|
||||||
{ m_context.begin_edition(); }
|
{ m_context.begin_edition(); }
|
||||||
|
|
||||||
~ScopedEdition()
|
~ScopedEdition() { m_context.end_edition(); }
|
||||||
{
|
|
||||||
// If buffer changed, the edition count
|
|
||||||
// was reset.
|
|
||||||
if (m_buffer == &m_context.buffer())
|
|
||||||
m_context.end_edition();
|
|
||||||
}
|
|
||||||
|
|
||||||
Context& context() const { return m_context; }
|
Context& context() const { return m_context; }
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user