diff options
| author | Maxime Coste <mawww@kakoune.org> | 2022-02-22 08:28:33 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2022-02-22 08:28:33 +1100 |
| commit | 30c05e83f8cbd0e116b9f8652f1cd2ade95add80 (patch) | |
| tree | 778e1186d5ab0822ebf6f006718d441922e3fc81 /src/buffer.cc | |
| parent | 3f856d4e30006997189d2e0c602bd4e830eb2350 (diff) | |
Remove unnecessary workaround in Buffer::insert
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 5 |
1 files changed, 1 insertions, 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()); } |
