diff --git a/src/line_change_watcher.cc b/src/line_change_watcher.cc index 1fff0f342..3eeba883d 100644 --- a/src/line_change_watcher.cc +++ b/src/line_change_watcher.cc @@ -61,6 +61,11 @@ std::vector LineChangeWatcher::compute_modifications() void LineChangeWatcher::on_insert(const Buffer& buffer, BufferCoord begin, BufferCoord end) { + if (buffer.is_end(end)) + { + kak_assert(begin.column == 0); + --begin.line; + } m_changes.push_back({begin.line, end.line - begin.line}); }