summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-01-21 10:24:08 +1100
committerMaxime Coste <mawww@kakoune.org>2024-01-21 10:24:08 +1100
commit5ea5c99c58ea9e71e9239366a6faf78aa20ecb0d (patch)
tree4a87b5f722712c6e5aef3d23502154cd2d42f436 /src/buffer.cc
parent06743119458e425b7525c6aa424a54077bc64244 (diff)
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
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc2
1 files changed, 1 insertions, 1 deletions
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 });