From b532e80ac8390584aadefa723839f3b1e54d9bce Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 7 Nov 2016 22:15:29 -0500 Subject: [PATCH] add Cursor::address() --- src/core/GapBuffer.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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;