diff options
| author | Maxime Coste <mawww@kakoune.org> | 2018-06-03 14:30:24 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2018-07-05 07:54:28 +1000 |
| commit | d6c6ed9bbf9185ad80f640078202c80cf1b2ae4e (patch) | |
| tree | 405dcc2b1d9130f27d063486b02042722abb99c9 /src/selection.cc | |
| parent | 8aba0b3cb4e5fe758328eba9eeba0401b4e77e52 (diff) | |
Store each selection as a separate element in a register
It makes more sense to use the list nature of the register to store
the selections instead of storing them as a single string separated
by spaces.
Diffstat (limited to 'src/selection.cc')
| -rw-r--r-- | src/selection.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/selection.cc b/src/selection.cc index 1cd8641c..02358fea 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -27,10 +27,7 @@ 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) - : SelectionList(UnsortedTag{}, buffer, std::move(list), buffer.timestamp()) {} - -SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector<Selection> list, size_t timestamp) +SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector<Selection> list, size_t timestamp, size_t main) : m_buffer(&buffer), m_selections(std::move(list)), m_timestamp(timestamp) { sort_and_merge_overlapping(); @@ -509,7 +506,7 @@ SelectionList selection_list_from_string(Buffer& buffer, ConstArrayView<String> 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)}; + return {SelectionList::UnsortedTag{}, buffer, std::move(sels), buffer.timestamp(), 0}; } } |
