From 3d430e14c4179a8c6865f1ec131c164ca44c1a51 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 28 Jan 2013 13:45:32 +0100 Subject: [PATCH] Buffer: small fix in apply_modification --- src/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index deb833f1..57531c9a 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -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());