diff --git a/src/selectors.cc b/src/selectors.cc index 3d9b453d..febcde78 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -420,6 +420,15 @@ select_to_reverse(const Context& context, const Selection& selection, Codepoint c, int count, bool inclusive) { auto& buffer = context.buffer(); + + // if we are selecting backwards from the beginning of the buffer, + // there is nothing more that can be selected. + // Unless its inclusive, in which its possible that the current + // location of the cursor contains the Codepoint being looked for. + if(!inclusive && selection.cursor() == buffer.begin()){ + return {}; + } + Utf8Iterator begin{buffer.iterator_at(selection.cursor()), buffer}; Utf8Iterator end = begin; do