From d6c6ed9bbf9185ad80f640078202c80cf1b2ae4e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 3 Jun 2018 14:30:24 +1000 Subject: 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. --- src/selection.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/selection.cc') 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 list, size_t time SelectionList::SelectionList(Buffer& buffer, Vector list) : SelectionList(buffer, std::move(list), buffer.timestamp()) {} -SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector list) - : SelectionList(UnsortedTag{}, buffer, std::move(list), buffer.timestamp()) {} - -SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector list, size_t timestamp) +SelectionList::SelectionList(SelectionList::UnsortedTag, Buffer& buffer, Vector 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 auto sels = descs | transform([&](auto&& d) { auto s = selection_from_string(d); clamp(s, buffer); return s; }) | gather>(); - return {SelectionList::UnsortedTag{}, buffer, std::move(sels)}; + return {SelectionList::UnsortedTag{}, buffer, std::move(sels), buffer.timestamp(), 0}; } } -- cgit v1.2.3