diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-03-15 16:51:55 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-03-15 16:51:55 +0000 |
| commit | a88e58763bd33e021511d2e821703f478afd85bf (patch) | |
| tree | 7c4ddd9006bd8fd51bcb17edb209d44571ebd694 /src | |
| parent | 5705b6c6f938589d3a63a3e632bc93266c78ec17 (diff) | |
Move SelectionList::set implementation out of the header
Diffstat (limited to 'src')
| -rw-r--r-- | src/selection.cc | 10 | ||||
| -rw-r--r-- | src/selection.hh | 11 |
2 files changed, 11 insertions, 10 deletions
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<Selection> 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<Selection> list, size_t main); SelectionList& operator=(Vector<Selection> list) { const size_t main_index = list.size()-1; @@ -112,16 +113,6 @@ struct SelectionList return *this; } - void set(Vector<Selection> 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<Selection>::iterator; iterator begin() { return m_selections.begin(); } iterator end() { return m_selections.end(); } |
