diff --git a/src/selection.cc b/src/selection.cc index 7424067b..542c44f5 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -42,6 +42,16 @@ void SelectionList::remove(size_t index) if (index < m_main or m_main == m_selections.size()) --m_main; } +void SelectionList::set(Vector list, size_t main) +{ + kak_assert(main < list.size()); + m_selections = std::move(list); + m_main = main; + sort_and_merge_overlapping(); + update_timestamp(); + check_invariant(); +} + namespace { diff --git a/src/selection.hh b/src/selection.hh index d1fac7fa..08451521 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -105,6 +105,7 @@ struct SelectionList Selection& operator[](size_t i) { return m_selections[i]; } const Selection& operator[](size_t i) const { return m_selections[i]; } + void set(Vector list, size_t main); SelectionList& operator=(Vector list) { const size_t main_index = list.size()-1; @@ -112,16 +113,6 @@ struct SelectionList return *this; } - void set(Vector list, size_t main) - { - kak_assert(main < list.size()); - m_selections = std::move(list); - m_main = main; - sort_and_merge_overlapping(); - update_timestamp(); - check_invariant(); - } - using iterator = Vector::iterator; iterator begin() { return m_selections.begin(); } iterator end() { return m_selections.end(); }