From 30c05e83f8cbd0e116b9f8652f1cd2ade95add80 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 22 Feb 2022 08:28:33 +1100 Subject: [PATCH] Remove unnecessary workaround in Buffer::insert --- src/buffer.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 2ed27bb8..23de1cdc 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -505,11 +505,8 @@ BufferRange Buffer::insert(BufferCoord pos, StringView content) else real_content = intern(content); - // for undo and redo purpose it is better to use one past last line rather - // than one past last char coord. - auto coord = is_end(pos) ? line_count() : pos; if (not (m_flags & Flags::NoUndo)) - m_current_undo_group.push_back({Modification::Insert, coord, real_content}); + m_current_undo_group.push_back({Modification::Insert, pos, real_content}); return do_insert(pos, real_content->strview()); }