DisplayAtom: only let DisplayLine touch m_begin and m_end
This commit is contained in:
parent
7e046e3f0b
commit
5602bc10e8
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user