Skip to content

Commit

Permalink
Merge remote-tracking branch 'potatoalienof13/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mawww committed Mar 9, 2023
2 parents 706e5bd + 96ddc4c commit 38077ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/selectors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ 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.
if (selection.cursor() == buffer.begin())
return {};

Utf8Iterator begin{buffer.iterator_at(selection.cursor()), buffer};
Utf8Iterator end = begin;
do
Expand Down
1 change: 1 addition & 0 deletions test/regression/4471-crash-on-alt-t-with-one-char-file/cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a-t><ret>
Empty file.

0 comments on commit 38077ca

Please sign in to comment.