diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 20:56:27 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-05-14 20:56:49 +0100 |
| commit | 4e280977a2fcd7ca423b5909b435b896b256cdaf (patch) | |
| tree | caf34647ab26f749f5c63f5af71f34302bc5e261 /src/selection.hh | |
| parent | c3f4ef9ba2e8ca58acc6cf56e552341a5af62f5d (diff) | |
Iterate in reversed order on selections when modifing buffer
This way, update only needs to be called once everything is done
as we always modify after the next selection to be used.
Diffstat (limited to 'src/selection.hh')
| -rw-r--r-- | src/selection.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/selection.hh b/src/selection.hh index f8727b90..5f0ce459 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -73,6 +73,8 @@ struct SelectionList void rotate_main(int count) { m_main = (m_main + count) % size(); } + void avoid_eol(); + void push_back(const Selection& sel) { m_selections.push_back(sel); } void push_back(Selection&& sel) { m_selections.push_back(std::move(sel)); } @@ -92,6 +94,10 @@ struct SelectionList iterator begin() { return m_selections.begin(); } iterator end() { return m_selections.end(); } + using reverse_iterator = std::vector<Selection>::reverse_iterator; + reverse_iterator rbegin() { return m_selections.rbegin(); } + reverse_iterator rend() { return m_selections.rend(); } + using const_iterator = std::vector<Selection>::const_iterator; const_iterator begin() const { return m_selections.begin(); } const_iterator end() const { return m_selections.end(); } |
