1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-04 16:53:27 +03:00

Extract variable in selection undo

No functional change.
This commit is contained in:
Johannes Altmanninger 2022-12-03 16:52:08 +01:00
parent a50cb5f6e7
commit 02d0584e0f

View File

@ -242,10 +242,11 @@ void Context::SelectionHistory::undo()
current_history_node().redo_child = previous_id;
m_staging = current_history_node();
};
if (&history_node(next).selections.buffer() == &m_context.buffer())
Buffer& destination_buffer = history_node(next).selections.buffer();
if (&destination_buffer == &m_context.buffer())
select_next();
else
m_context.change_buffer(history_node(next).selections.buffer(), { std::move(select_next) });
m_context.change_buffer(destination_buffer, { std::move(select_next) });
}
void Context::SelectionHistory::forget_buffer(Buffer& buffer)