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/insert_completer.cc | |
| 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/insert_completer.cc')
| -rw-r--r-- | src/insert_completer.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/insert_completer.cc b/src/insert_completer.cc index dd048733..83e51d63 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -495,6 +495,8 @@ void InsertCompleter::reset() { auto& buffer = m_context.buffer(); update_ranges(buffer, m_completions.timestamp, m_inserted_ranges); + m_completions.timestamp = buffer.timestamp(); + hook_param = join(m_inserted_ranges | filter([](auto&& r) { return not r.empty(); }) | transform([&](auto&& r) { return selection_to_string(ColumnType::Byte, buffer, {r.begin, buffer.char_prev(r.end)}); }), ' '); |
