summaryrefslogtreecommitdiff
path: root/src/selection.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-07-16 21:51:37 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-07-16 21:51:37 +0200
commit31c0931dffbbf100ddcf1f2f2edc0d830fec8f39 (patch)
treea9543e8572a81bd170a631973b48896801dd2b73 /src/selection.hh
parentfe988868e576b9b7fe047a7465d1b1f6867bf786 (diff)
Go back to a generic BufferChangeListener interface for selection update
Diffstat (limited to 'src/selection.hh')
-rw-r--r--src/selection.hh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/selection.hh b/src/selection.hh
index b29af9a2..29a008a2 100644
--- a/src/selection.hh
+++ b/src/selection.hh
@@ -12,7 +12,7 @@ namespace Kakoune
// Selections are oriented, first may be > last, and inclusive.
// Selection updates it's iterators according to modifications made
// in the buffer.
-struct Selection
+struct Selection : public BufferChangeListener
{
Selection(const BufferIterator& first, const BufferIterator& last);
Selection(const Selection& other);
@@ -30,6 +30,9 @@ struct Selection
void merge_with(const Selection& selection);
+ void on_insert(const BufferIterator& begin, const BufferIterator& end);
+ void on_erase(const BufferIterator& begin, const BufferIterator& end);
+
private:
BufferIterator m_first;
BufferIterator m_last;