Fix crash recently introduced when deleting at buffer start in insert mode

This commit is contained in:
Maxime Coste 2017-06-15 17:33:42 +01:00
parent e6c4bed42b
commit 01a1e92b79
4 changed files with 7 additions and 2 deletions

View File

@ -1110,8 +1110,10 @@ public:
sels.emplace_back(buffer.char_prev(pos));
}
auto& main = context().selections().main();
String main_char = buffer.string(buffer.char_prev(main.cursor()),
main.cursor());
String main_char;
if (main.cursor() != BufferCoord{0, 0})
main_char = buffer.string(buffer.char_prev(main.cursor()),
main.cursor());
if (not sels.empty())
SelectionList{buffer, std::move(sels)}.erase();

View File

@ -0,0 +1 @@
i<backspace><esc>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@