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
This commit is contained in:
Maxime Coste 2024-01-21 10:24:08 +11:00
parent 0674311945
commit 5ea5c99c58

View File

@ -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 });