summaryrefslogtreecommitdiff
path: root/src/editor.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-11-12 13:40:07 +0100
committerMaxime Coste <frrrwww@gmail.com>2012-11-12 13:40:07 +0100
commit39932f7ea2a4e46e8d1ba2d527435a033af1413a (patch)
tree7e879623d4d2c12e3122a3b6ab5ef190c8beef35 /src/editor.cc
parent2781056ce6b70c20b2412ba05833680683d12ef5 (diff)
Fix IncrementalInserter::insert(memoryview<String>) so that inserting registers works as intended
Diffstat (limited to 'src/editor.cc')
-rw-r--r--src/editor.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/editor.cc b/src/editor.cc
index a544bae7..9694b501 100644
--- a/src/editor.cc
+++ b/src/editor.cc
@@ -423,13 +423,18 @@ void IncrementalInserter::insert(const String& string)
BufferIterator position = sel.last();
String content = string;
m_editor.filters()(buffer, position, content);
- m_editor.buffer().insert(position, content);
+ buffer.insert(position, content);
}
}
void IncrementalInserter::insert(const memoryview<String>& strings)
{
- m_editor.insert(strings);
+ for (size_t i = 0; i < m_editor.m_selections.size(); ++i)
+ {
+ size_t index = std::min(i, strings.size()-1);
+ m_editor.buffer().insert(m_editor.m_selections[i].last(),
+ strings[index]);
+ }
}
void IncrementalInserter::erase()