diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-02-02 13:24:40 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-02-02 13:24:40 +0000 |
| commit | c004187f32386431d0b84d6e59edb4cd7aba7e8a (patch) | |
| tree | b4c18aaa822fc15d7452ac073972f6bdc73986f8 /src/buffer.cc | |
| parent | 09fc14be4b7169e3d5fbae3995c3ee9c6db03150 (diff) | |
Fix buffer reloading
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index 298f9609..a3b23c70 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -171,12 +171,13 @@ void Buffer::reload(BufferLines lines, time_t fs_timestamp) if (lines.empty()) lines.emplace_back(StringStorage::create("\n")); - for (auto& line : lines) + for (size_t l = 0; l < lines.size(); ++l) { + auto& line = lines[l]; kak_assert(not line->length == 0 and line->data()[line->length-1] == '\n'); if (not (m_flags & Flags::NoUndo)) m_current_undo_group.emplace_back( - Modification::Insert, line_count()-1, m_lines.back()); + Modification::Insert, LineCount{(int)l}, SharedString{line}); } static_cast<BufferLines&>(m_lines) = std::move(lines); |
