diff options
| author | Jason Felice <jason.m.felice@gmail.com> | 2019-10-27 13:08:53 -0400 |
|---|---|---|
| committer | Jason Felice <jason.m.felice@gmail.com> | 2019-11-07 14:51:04 -0500 |
| commit | c9fce9f83d313d01f72ec78ab62f27a898921889 (patch) | |
| tree | 68fd488904ca9f276b3aefa3df33e16ca588e8f9 /src/selection.cc | |
| parent | ec31d839724cfd0f8431c04509f1f1d2b5fa1290 (diff) | |
Merge selection list parsing into selection_list_from_strings
Diffstat (limited to 'src/selection.cc')
| -rw-r--r-- | src/selection.cc | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/selection.cc b/src/selection.cc index 9e300af6..e0dbbecb 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -27,13 +27,6 @@ SelectionList::SelectionList(Buffer& buffer, Vector<Selection> list, size_t time SelectionList::SelectionList(Buffer& buffer, Vector<Selection> list) : SelectionList(buffer, std::move(list), buffer.timestamp()) {} -SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector<Selection> list, size_t timestamp, size_t main) - : m_selections(std::move(list)), m_buffer(&buffer), m_timestamp(timestamp) -{ - sort_and_merge_overlapping(); - check_invariant(); -} - void SelectionList::remove(size_t index) { m_selections.erase(begin() + index); @@ -518,14 +511,4 @@ Selection selection_from_string(StringView desc) return Selection{anchor, cursor}; } -SelectionList selection_list_from_string(Buffer& buffer, ConstArrayView<String> descs, size_t timestamp) -{ - if (descs.empty()) - throw runtime_error{"empty selection description"}; - - auto sels = descs | transform([&](auto&& d) { auto s = selection_from_string(d); clamp(s, buffer); return s; }) - | gather<Vector<Selection>>(); - return {SelectionList::UnsortedTag{}, buffer, std::move(sels), timestamp, 0}; -} - } |
