From 54725ebcca98c2f89517a838f1c9b516c8b1b74e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 24 Jan 2013 14:08:24 +0100 Subject: [PATCH] Buffer::do_insert: fix on_insert call when inserting at the end --- src/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index d94c5617..deb833f1 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -272,7 +272,7 @@ void Buffer::do_insert(const BufferIterator& pos, const String& content) if (start != content.length()) m_lines.push_back({ offset + start, content.substr(start) }); - begin_it = BufferIterator{*this, { pos.line() + 1, 0 }}; + begin_it = pos.column() == 0 ? pos : BufferIterator{*this, { pos.line() + 1, 0 }}; end_it = end(); } else