summaryrefslogtreecommitdiff
path: root/src/editor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/editor.cc')
-rw-r--r--src/editor.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/editor.cc b/src/editor.cc
index c03fd396..ae156041 100644
--- a/src/editor.cc
+++ b/src/editor.cc
@@ -558,8 +558,10 @@ void IncrementalInserter::erase()
auto& buffer = m_editor.buffer();
for (auto& sel : m_editor.m_selections)
{
+ if (sel.last() == BufferCoord{0,0})
+ continue;
auto pos = buffer.iterator_at(sel.last());
- buffer.erase(pos-1, pos);
+ buffer.erase(utf8::previous(pos), pos);
}
}