diff options
| author | Maxime Coste <mawww@kakoune.org> | 2022-11-28 20:27:44 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2022-11-28 20:27:44 +1100 |
| commit | 2688893156ca45672b1d277092c0cc9004eaffae (patch) | |
| tree | 6fdef59cc650b6b2171e987e4e95e13d20921259 /src/changes.hh | |
| parent | 760a45556cfb8f50813ce8d1712a0a23f86dcf52 (diff) | |
Fix pasting after when selections are overlapping
With overlapping selections, pasting after breaks assumption of
SelectionList::for_each as our changes are no longer happening in
increasing locations.
We hence cannot rely on the ForwardChangeTracker in that case and
have to rely on the more general (and more costly) ranges update logic.
This interacts poorly with paste linewise pastes and we try to preserve
the current behaviour by tracking the last paste position.
Overall, this change really begs for overlapping selections to be
removed, but we will fix them like that for now.
Fixes #4779
Diffstat (limited to 'src/changes.hh')
| -rw-r--r-- | src/changes.hh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/changes.hh b/src/changes.hh index 9d0328d4..c5ad0134 100644 --- a/src/changes.hh +++ b/src/changes.hh @@ -82,7 +82,7 @@ void update_backward(ConstArrayView<Buffer::Change> changes, RangeContainer& ran } template<typename RangeContainer> -void update_ranges(Buffer& buffer, size_t& timestamp, RangeContainer&& ranges) +void update_ranges(Buffer& buffer, size_t timestamp, RangeContainer&& ranges) { if (timestamp == buffer.timestamp()) return; @@ -104,7 +104,6 @@ void update_ranges(Buffer& buffer, size_t& timestamp, RangeContainer&& ranges) change_it = backward_end; } } - timestamp = buffer.timestamp(); } } |
