From 5ea5c99c58ea9e71e9239366a6faf78aa20ecb0d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 21 Jan 2024 10:24:08 +1100 Subject: Fix using invalid strings for undo content strings The code was wrongly using the write_it instead of the read_it to access the removed lines content. Fixes #5088 --- src/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buffer.cc') diff --git a/src/buffer.cc b/src/buffer.cc index b9335322..7054e6b8 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -261,7 +261,7 @@ void Buffer::reload(BufferLines lines, ByteOrderMark bom, EolFormat eolformat, F for (LineCount line = len-1; line >= 0; --line) m_current_undo_group.push_back({ Modification::Erase, cur_line + line, - m_lines.get_storage(cur_line + line)}); + *(read_it + (size_t)line)}); read_it += len; m_changes.push_back({ Change::Erase, cur_line, cur_line + len }); -- cgit v1.2.3