Fix end_it computation in Buffer::insert, avoid clamping in iterator_at
This commit is contained in:
parent
c915e18950
commit
4908b2c3ef
|
@ -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 });
|
line_it = m_lines.insert(line_it, { offset + start, content.substr(start) + suffix });
|
||||||
|
|
||||||
begin_it = pos;
|
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();
|
check_invariant();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user