summaryrefslogtreecommitdiff
path: root/src/selection.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-07-03 00:25:39 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-07-05 12:10:06 +0100
commitd181a40a91f87e1fb2490281947f07b2fcd071bc (patch)
tree96220217e54f839d195c397527425f5e49f2bd9d /src/selection.cc
parent8795efdf19ad72d85b2cdc1ec1db447178520b74 (diff)
Add support for paste all (on <a-[pP]>)
Paste all pastes all yanked text at all selections, selecting each pasted text. Replace paste moves to R, and concat yank/concat delete (Y and D) are removed. Fixes #161
Diffstat (limited to 'src/selection.cc')
-rw-r--r--src/selection.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/selection.cc b/src/selection.cc
index bd18bf85..f6eab856 100644
--- a/src/selection.cc
+++ b/src/selection.cc
@@ -463,7 +463,8 @@ BufferIterator prepare_insert(Buffer& buffer, const Selection& sel, InsertMode m
return {};
}
-void SelectionList::insert(memoryview<String> strings, InsertMode mode)
+void SelectionList::insert(memoryview<String> strings, InsertMode mode,
+ bool select_inserted)
{
if (strings.empty())
return;
@@ -496,7 +497,7 @@ void SelectionList::insert(memoryview<String> strings, InsertMode mode)
changes_tracker.update(change);
m_timestamp = m_buffer->timestamp();
- if (mode == InsertMode::Replace)
+ if (select_inserted or mode == InsertMode::Replace)
{
sel.anchor() = change.begin;
sel.cursor() = m_buffer->char_prev(change.end);