diff --git a/src/core/GapBuffer.h b/src/core/GapBuffer.h index c544763..0931e9e 100644 --- a/src/core/GapBuffer.h +++ b/src/core/GapBuffer.h @@ -41,8 +41,8 @@ public: return 0xFFFFFFFFu; } } - GapBuffer * gap_buffer() { return m_gap_buffer; } - bool operator<(const Iterator & other) + GapBuffer * gap_buffer() const { return m_gap_buffer; } + bool operator<(const Iterator & other) const { return m_offset < other.m_offset; } @@ -69,11 +69,12 @@ public: bool go_right(bool allow_eol); bool go_up(size_t target_column); bool go_down(size_t target_column); - bool operator<(const Cursor & other) + bool operator<(const Cursor & other) const { return m_iterator < other.m_iterator; } - uint32_t operator*() { return *m_iterator; } + uint32_t operator*() const { return *m_iterator; } + uint8_t * address() const { return m_iterator.address(); } protected: Iterator m_iterator;