Remove a check for inclusivity in select_to_reverse.

It turns out that neither <a-f> or <a-t> make sense when run at the
beginning of the buffer. When I first created the check, I thought
that <a-f> made sense if the character under the cursor was the
character being searched for.  I was wrong, <a-f> should always go
at least one character backwards.
This commit is contained in:
potatoalienof13 2022-12-23 11:52:02 -05:00
parent 7c2d060ec0
commit eb447f1c43

View File

@ -423,11 +423,8 @@ select_to_reverse(const Context& context, const Selection& selection,
// if we are selecting backwards from the beginning of the buffer, // if we are selecting backwards from the beginning of the buffer,
// there is nothing more that can be selected. // there is nothing more that can be selected.
// Unless its inclusive, in which its possible that the current if (selection.cursor() == buffer.begin())
// location of the cursor contains the Codepoint being looked for.
if(!inclusive && selection.cursor() == buffer.begin()){
return {}; return {};
}
Utf8Iterator begin{buffer.iterator_at(selection.cursor()), buffer}; Utf8Iterator begin{buffer.iterator_at(selection.cursor()), buffer};
Utf8Iterator end = begin; Utf8Iterator end = begin;