From c6a8d1597ef8fe58924b6ca3816ece5565ef9a72 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 15 Oct 2016 18:40:36 -0400 Subject: [PATCH] insert-after-char should insert-before-char if char is EOL marker --- src/core/PieceTable.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/PieceTable.cc b/src/core/PieceTable.cc index 599bd49..d2bd0e8 100644 --- a/src/core/PieceTable.cc +++ b/src/core/PieceTable.cc @@ -342,7 +342,7 @@ void PieceTable::begin_insert(const Cursor & cursor, bool before) { Piece * piece = cursor.iterator.piece; uint32_t offset = cursor.iterator.offset; - if (!before && cursor.iterator.has_char()) + if (!before && cursor.iterator.has_char() && (*cursor != INTERNAL_EOL)) { offset += cursor.iterator.num_bytes_in_code_point(); }