From 22f2f68d5873cc3d38af98e74dcc99d3cd9c7dd7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 28 Jan 2014 19:07:36 +0000 Subject: [PATCH] Fix LineChangeWatcher behaviour when inserting at buffer end --- src/line_change_watcher.cc | 5 +++++ 1 file changed, 5 insertions(+) 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}); }