diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-06-15 17:33:42 +0100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-06-15 17:35:48 +0100 |
| commit | 01a1e92b79e6bbebaf4b3896697ec1aebe5a9a8a (patch) | |
| tree | 556ccf7d2344d7deff2ed7725688402296db4af8 /src/input_handler.cc | |
| parent | e6c4bed42b73745681b12cac0178558fc380f36c (diff) | |
Fix crash recently introduced when deleting at buffer start in insert mode
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index 06f1eb1e..8b91d1a4 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -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(); |
