diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-11-19 13:40:23 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-11-19 13:40:23 +0100 |
| commit | 45bd3dbe5a9d6234f4ad01e3e656b827bf9aaf6d (patch) | |
| tree | a97e903997d7220ff0d0eecbf9b8109418cff8f5 /src/editor.cc | |
| parent | fd50046f3a2119e861e0aee84b7737c5c0ebad32 (diff) | |
Pass the selection instead of only point of insertion to filters
Diffstat (limited to 'src/editor.cc')
| -rw-r--r-- | src/editor.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/editor.cc b/src/editor.cc index 36931e80..9c6a97c0 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -408,15 +408,13 @@ IncrementalInserter::~IncrementalInserter() m_editor.on_incremental_insertion_end(); } -void IncrementalInserter::insert(const String& string) +void IncrementalInserter::insert(String content) { Buffer& buffer = m_editor.buffer(); for (auto& sel : m_editor.m_selections) { - BufferIterator position = sel.last(); - String content = string; - m_editor.filters()(buffer, position, content); - buffer.insert(position, content); + m_editor.filters()(buffer, sel.selection, content); + buffer.insert(sel.last(), content); } } |
