Fix crash recently introduced when deleting at buffer start in insert mode
This commit is contained in:
parent
e6c4bed42b
commit
01a1e92b79
|
@ -1110,7 +1110,9 @@ public:
|
||||||
sels.emplace_back(buffer.char_prev(pos));
|
sels.emplace_back(buffer.char_prev(pos));
|
||||||
}
|
}
|
||||||
auto& main = context().selections().main();
|
auto& main = context().selections().main();
|
||||||
String main_char = buffer.string(buffer.char_prev(main.cursor()),
|
String main_char;
|
||||||
|
if (main.cursor() != BufferCoord{0, 0})
|
||||||
|
main_char = buffer.string(buffer.char_prev(main.cursor()),
|
||||||
main.cursor());
|
main.cursor());
|
||||||
if (not sels.empty())
|
if (not sels.empty())
|
||||||
SelectionList{buffer, std::move(sels)}.erase();
|
SelectionList{buffer, std::move(sels)}.erase();
|
||||||
|
|
1
test/regression/0-crash-on-backspace-at-buffer-begin/cmd
Normal file
1
test/regression/0-crash-on-backspace-at-buffer-begin/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
i<backspace><esc>
|
1
test/regression/0-crash-on-backspace-at-buffer-begin/in
Normal file
1
test/regression/0-crash-on-backspace-at-buffer-begin/in
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
1
test/regression/0-crash-on-backspace-at-buffer-begin/out
Normal file
1
test/regression/0-crash-on-backspace-at-buffer-begin/out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
Loading…
Reference in New Issue
Block a user