diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2022-12-03 12:36:33 +0100 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2022-12-27 18:24:55 +0100 |
| commit | 016e1be77fd34610cae082fd8d90e846ed8af28e (patch) | |
| tree | 53d4b1b875923f9e2f4a9bd524707a791e073878 /src | |
| parent | 02d0584e0f29abab29a0397f582c0c521c6c0470 (diff) | |
Extract variable and add comment in selection change recording
No functional change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/context.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/context.cc b/src/context.cc index 2afa278a..568142c6 100644 --- a/src/context.cc +++ b/src/context.cc @@ -204,9 +204,11 @@ void Context::SelectionHistory::end_edition() if (m_history_id != HistoryId::Invalid and current_history_node().selections == m_staging->selections) { - auto& sels = m_history[(size_t)m_history_id].selections; - sels.force_timestamp(m_staging->selections.timestamp()); - sels.set_main_index(m_staging->selections.main_index()); + // No change, except maybe the index of the main selection. + // Update timestamp to potentially improve interaction with content undo. + auto& node = current_history_node(); + node.selections.force_timestamp(m_staging->selections.timestamp()); + node.selections.set_main_index(m_staging->selections.main_index()); } else { |
