From 02d0584e0f29abab29a0397f582c0c521c6c0470 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 3 Dec 2022 16:52:08 +0100 Subject: [PATCH] Extract variable in selection undo No functional change. --- src/context.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/context.cc b/src/context.cc index 3446c2e4..2afa278a 100644 --- a/src/context.cc +++ b/src/context.cc @@ -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)