Buffer: small fix in apply_modification

This commit is contained in:
Maxime Coste 2013-01-28 13:45:32 +01:00
parent 54725ebcca
commit 3d430e14c4

View File

@ -353,7 +353,7 @@ void Buffer::apply_modification(const Modification& modification)
// this may happen when a modification applied at the
// end of the buffer has been inverted for an undo.
if (pos.column() == m_lines[pos.line()].length())
if (not pos.is_end() and pos.column() == m_lines[pos.line()].length())
pos = { pos.buffer(), { pos.line() + 1, 0 }};
assert(pos.is_valid());