summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc6
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();