summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2022-11-28 20:27:44 +1100
committerMaxime Coste <mawww@kakoune.org>2022-11-28 20:27:44 +1100
commit2688893156ca45672b1d277092c0cc9004eaffae (patch)
tree6fdef59cc650b6b2171e987e4e95e13d20921259 /src/input_handler.cc
parent760a45556cfb8f50813ce8d1712a0a23f86dcf52 (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/input_handler.cc')
-rw-r--r--src/input_handler.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 61a07a40..f90d2d22 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -1470,7 +1470,7 @@ private:
context().selections().for_each([strings, &buffer=context().buffer()]
(size_t index, Selection& sel) {
Kakoune::insert(buffer, sel, sel.cursor(), strings[std::min(strings.size()-1, index)]);
- });
+ }, false);
}
void insert(Codepoint key)