Fix LineChangeWatcher behaviour when inserting at buffer end

This commit is contained in:
Maxime Coste 2014-01-28 19:07:36 +00:00
parent 5b3233184e
commit 22f2f68d58

View File

@ -61,6 +61,11 @@ std::vector<LineModification> LineChangeWatcher::compute_modifications()
void LineChangeWatcher::on_insert(const Buffer& buffer, BufferCoord begin, BufferCoord end) 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}); m_changes.push_back({begin.line, end.line - begin.line});
} }