diff --git a/src/display_buffer.hh b/src/display_buffer.hh index 3b69bd00..2b3fcc0e 100644 --- a/src/display_buffer.hh +++ b/src/display_buffer.hh @@ -57,6 +57,18 @@ public: } } + CharCount length() const + { + switch (m_type) + { + case BufferRange: + return m_end - m_begin; + case Text: + case ReplacedBufferRange: + return m_text.length(); + } + } + BufferIterator& begin() { assert(has_buffer_range());