From 2688893156ca45672b1d277092c0cc9004eaffae Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 28 Nov 2022 20:27:44 +1100 Subject: 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 --- src/input_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/input_handler.cc') 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) -- cgit v1.2.3