It can happen during an undo/redo that the buffer be temporarily empty
Fix is_end in that case.
This commit is contained in:
parent
79782fb903
commit
90d446b2f4
|
@ -104,7 +104,8 @@ inline ByteCoord Buffer::back_coord() const
|
|||
|
||||
inline ByteCoord Buffer::end_coord() const
|
||||
{
|
||||
return { line_count() - 1, m_lines.back().length() };
|
||||
return m_lines.empty() ?
|
||||
ByteCoord{0,0} : ByteCoord{ line_count() - 1, m_lines.back().length() };
|
||||
}
|
||||
|
||||
inline BufferIterator::BufferIterator(const Buffer& buffer, ByteCoord coord)
|
||||
|
|
Loading…
Reference in New Issue
Block a user