From 4908b2c3efcf028adcc1625fb9108014a7e49d47 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 18 Jul 2012 14:12:41 +0200 Subject: [PATCH] Fix end_it computation in Buffer::insert, avoid clamping in iterator_at --- src/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index b0263134..aa9b93c9 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -268,7 +268,7 @@ void Buffer::insert(const BufferIterator& pos, const String& content) line_it = m_lines.insert(line_it, { offset + start, content.substr(start) + suffix }); begin_it = pos; - end_it = iterator_at({ int(line_it - m_lines.begin()), int(line_it->length() - suffix.length()) }); + end_it = BufferIterator(*this, { int(line_it - m_lines.begin()), int(line_it->length() - suffix.length()) }); } check_invariant();