summaryrefslogtreecommitdiff
path: root/src/dynamic_selection_list.hh
blob: fc90dcfdffc469e67ae0c22d4ab6e22e4c3eaebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef dynamic_selection_list_hh_INCLUDED
#define dynamic_selection_list_hh_INCLUDED

#include "selection.hh"

namespace Kakoune
{

class DynamicSelectionList : public SelectionList,
                             public BufferChangeListener_AutoRegister
{
public:
    using iterator = SelectionList::iterator;
    using const_iterator = SelectionList::const_iterator;

    DynamicSelectionList(const Buffer& buffer, SelectionList selections = {});

    DynamicSelectionList& operator=(SelectionList selections);
    void check_invariant() const;

private:
    void on_insert(const Buffer& buffer, BufferCoord begin, BufferCoord end) override;
    void on_erase(const Buffer& buffer, BufferCoord begin, BufferCoord end) override;
};

}

#endif // dynamic_selection_list_hh_INCLUDED