diff --git a/src/display_buffer.cc b/src/display_buffer.cc index 5b8aaff3..ac2bb593 100644 --- a/src/display_buffer.cc +++ b/src/display_buffer.cc @@ -12,8 +12,8 @@ DisplayLine::iterator DisplayLine::split(iterator it, BufferIterator pos) assert(it->content.end() > pos); DisplayAtom atom = *it; - atom.content.end() = pos; - it->content.begin() = pos; + atom.content.m_end = pos; + it->content.m_begin = pos; return m_atoms.insert(it, std::move(atom)); } diff --git a/src/display_buffer.hh b/src/display_buffer.hh index 2b3fcc0e..e1f1442f 100644 --- a/src/display_buffer.hh +++ b/src/display_buffer.hh @@ -32,6 +32,8 @@ enum Attributes Bold = 8 }; +class DisplayLine; + struct AtomContent { public: @@ -69,13 +71,13 @@ public: } } - BufferIterator& begin() + const BufferIterator& begin() const { assert(has_buffer_range()); return m_begin; } - BufferIterator& end() + const BufferIterator& end() const { assert(has_buffer_range()); return m_end; @@ -96,6 +98,8 @@ public: Type type() const { return m_type; } private: + friend class DisplayLine; + Type m_type; BufferIterator m_begin;