diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-12-12 23:17:06 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-12-14 14:38:17 +0000 |
| commit | 894ee0297ea60c043a711fbbb5612eff8a68c3ee (patch) | |
| tree | ebd1b69b56827c1a96efccbf0b857bfb5b1a3962 /src/editor.hh | |
| parent | dffd68a8cad12de7542b751bf1ab15888610065f (diff) | |
Move main selection index to SelectionList
Diffstat (limited to 'src/editor.hh')
| -rw-r--r-- | src/editor.hh | 8 |
1 files changed, 3 insertions, 5 deletions
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<String> selections_content() const; bool undo(); @@ -97,7 +97,6 @@ private: safe_ptr<Buffer> 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); } |
