summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-01-01 17:31:47 +0000
committerMaxime Coste <mawww@kakoune.org>2017-01-01 17:31:47 +0000
commitcdb2c766a5480cf2352e7db9b57cc9fcb9a81df2 (patch)
treec8fc513f303ec14fd046bcd2cff7ff13ea6d424d /src/normal.cc
parent69789d4793f91daab4f489147338ed593f34093d (diff)
Refactor SelectionList::insert a bit
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/normal.cc b/src/normal.cc
index 1386567d..835a9d32 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -594,21 +594,22 @@ void paste_all(Context& context, NormalParams params)
offsets.push_back(all.length());
}
+ Vector<BufferCoord> insert_pos;
auto& selections = context.selections();
{
ScopedEdition edition(context);
- selections.insert(all, effective_mode, true);
+ selections.insert(all, effective_mode, &insert_pos);
}
const Buffer& buffer = context.buffer();
Vector<Selection> result;
- for (auto& selection : selections)
+ for (auto& ins_pos : insert_pos)
{
ByteCount pos = 0;
for (auto offset : offsets)
{
- result.push_back({ buffer.advance(selection.min(), pos),
- buffer.advance(selection.min(), offset-1) });
+ result.push_back({ buffer.advance(ins_pos, pos),
+ buffer.advance(ins_pos, offset-1) });
pos = offset;
}
}