diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-04-11 10:44:22 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-04-12 15:28:22 +1000 |
| commit | 7f556c1e871dbe9c43dd8350cb6419104dbc1d8d (patch) | |
| tree | 2798219a135468181b6bd970285977a28d9feb14 /src | |
| parent | e34735a35041c19cc80d24cab6237abd447b8924 (diff) | |
Rotate through strings when pasting instead of repeating the last
This seems like a better overall behaviour.
Closes #5135
Diffstat (limited to 'src')
| -rw-r--r-- | src/normal.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/normal.cc b/src/normal.cc index 2d80d26f..4ea202ae 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -694,7 +694,7 @@ void paste(Context& context, NormalParams params) ScopedEdition edition(context); ScopedSelectionEdition selection_edition{context}; context.selections().for_each([&, last=BufferCoord{}](size_t index, Selection& sel) mutable { - auto& str = strings[std::min(strings.size()-1, index)]; + auto& str = strings[index % strings.size()]; auto& min = sel.min(); auto& max = sel.max(); BufferRange range = (mode == PasteMode::Replace) ? |
