<a-t> should not succeed when run on the first character of a file.

This commit is contained in:
potatoalienof13 2022-12-17 15:29:56 -05:00
parent 86bd4efd25
commit 1a4737cd20

View File

@ -420,6 +420,15 @@ select_to_reverse(const Context& context, const Selection& selection,
Codepoint c, int count, bool inclusive) Codepoint c, int count, bool inclusive)
{ {
auto& buffer = context.buffer(); 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 begin{buffer.iterator_at(selection.cursor()), buffer};
Utf8Iterator end = begin; Utf8Iterator end = begin;
do do