diff options
Diffstat (limited to 'src/selection.cc')
| -rw-r--r-- | src/selection.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/selection.cc b/src/selection.cc index d408ddfd..cbf9bef2 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -399,11 +399,12 @@ void replace(Buffer& buffer, Selection& sel, StringView content) max = range.end > range.begin ? buffer.char_prev(range.end) : range.begin; } -void insert(Buffer& buffer, Selection& sel, BufferCoord pos, StringView content) +BufferRange insert(Buffer& buffer, Selection& sel, BufferCoord pos, StringView content) { auto range = buffer.insert(pos, content); sel.anchor() = buffer.clamp(update_insert(sel.anchor(), range.begin, range.end)); sel.cursor() = buffer.clamp(update_insert(sel.cursor(), range.begin, range.end)); + return range; } void SelectionList::replace(ConstArrayView<String> strings) |
