diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-07-30 19:09:36 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-07-30 19:18:01 +0100 |
| commit | 3c8df764be5ca2dc2ff423258ee7d14eb5409db2 (patch) | |
| tree | 41f2785a1a428fc899ad3101c7c761b399c24381 /src/editor.cc | |
| parent | 59dae9148bbc1244f0b9dcecb2bfc54d820b1565 (diff) | |
fix insert mode erase utf-8 handling, add unit test
Diffstat (limited to 'src/editor.cc')
| -rw-r--r-- | src/editor.cc | 4 |
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); } } |
