Fix insert completion at beginning of buffer

This commit is contained in:
Maxime Coste 2013-05-30 18:52:03 +02:00
parent 2d96f853f8
commit 8ddeb141c8

View File

@ -610,7 +610,7 @@ public:
for (auto& sel : m_context.editor().selections()) for (auto& sel : m_context.editor().selections())
{ {
auto offset = buffer.offset(sel.last()); auto offset = buffer.offset(sel.last());
if (offset > beg_offset and offset + end_offset < buffer_len and if (offset >= beg_offset and offset + end_offset < buffer_len and
std::equal(sel.last() - beg_offset, sel.last(), begin)) std::equal(sel.last() - beg_offset, sel.last(), begin))
{ {
buffer.erase(sel.last() - beg_offset, sel.last() + end_offset); buffer.erase(sel.last() - beg_offset, sel.last() + end_offset);