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/selection.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/selection.hh')
| -rw-r--r-- | src/selection.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/selection.hh b/src/selection.hh index 299406be..bdfd7d41 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -137,7 +137,7 @@ struct SelectionList void force_timestamp(size_t timestamp) { m_timestamp = timestamp; } using ApplyFunc = FunctionRef<void (size_t index, Selection& sel)>; - void for_each(ApplyFunc apply); + void for_each(ApplyFunc apply, bool may_append); void replace(ConstArrayView<String> strings); |
