From 894ee0297ea60c043a711fbbb5612eff8a68c3ee Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 12 Dec 2013 23:17:06 +0000 Subject: Move main selection index to SelectionList --- src/editor.hh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/editor.hh') diff --git a/src/editor.hh b/src/editor.hh index 8778a1a0..4037a76e 100644 --- a/src/editor.hh +++ b/src/editor.hh @@ -71,11 +71,11 @@ public: void select(SelectionList selections); void multi_select(const MultiSelector& selector); - void rotate_selections(int count) { m_main_sel = (m_main_sel + count) % m_selections.size(); } + void rotate_selections(int count) { m_selections.rotate_main(count); } const SelectionList& selections() const { return m_selections; } - const Selection& main_selection() const { return m_selections[m_main_sel]; } - size_t main_selection_index() const { return m_main_sel; } + const Selection& main_selection() const { return m_selections.main(); } + size_t main_selection_index() const { return m_selections.main_index(); } std::vector selections_content() const; bool undo(); @@ -97,7 +97,6 @@ private: safe_ptr m_buffer; DynamicSelectionList m_selections; - size_t m_main_sel; }; struct scoped_edition @@ -116,7 +115,6 @@ private: void avoid_eol(const Buffer& buffer, BufferCoord& coord); void avoid_eol(const Buffer& buffer, Range& sel); -void sort_and_merge_overlapping(SelectionList& selections, size_t& main_selection); } -- cgit v1.2.3