2012-12-11 19:51:59 +01:00
|
|
|
#ifndef dynamic_selection_list_hh_INCLUDED
|
|
|
|
#define dynamic_selection_list_hh_INCLUDED
|
|
|
|
|
|
|
|
#include "selection.hh"
|
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2012-12-12 14:21:50 +01:00
|
|
|
class DynamicSelectionList : public SelectionList, public BufferChangeListener
|
2012-12-11 19:51:59 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
using iterator = SelectionList::iterator;
|
|
|
|
using const_iterator = SelectionList::const_iterator;
|
|
|
|
|
|
|
|
DynamicSelectionList(const Buffer& buffer, SelectionList selections = {});
|
|
|
|
~DynamicSelectionList();
|
|
|
|
|
|
|
|
DynamicSelectionList(const DynamicSelectionList& other);
|
|
|
|
DynamicSelectionList& operator=(const DynamicSelectionList& other);
|
|
|
|
DynamicSelectionList(DynamicSelectionList&& other);
|
|
|
|
DynamicSelectionList& operator=(DynamicSelectionList&& other);
|
|
|
|
|
2012-12-12 14:21:50 +01:00
|
|
|
DynamicSelectionList& operator=(SelectionList selections);
|
|
|
|
void check_invariant() const;
|
2012-12-11 19:51:59 +01:00
|
|
|
|
|
|
|
const Buffer& buffer() const { return *m_buffer; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
void on_insert(const BufferIterator& begin,
|
|
|
|
const BufferIterator& end) override;
|
|
|
|
void on_erase(const BufferIterator& begin,
|
|
|
|
const BufferIterator& end) override;
|
|
|
|
|
|
|
|
const Buffer* m_buffer;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // dynamic_selection_list_hh_INCLUDED
|
|
|
|
|