1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:05:08 +00:00

GTextEditor: Fixed bug in find_prev

Find_prev returned invalid when the contents of the file were equal to
the contents of the search box.

This is due to the checker walking on an empty character at the end of
a line.
This commit is contained in:
Andrew Weller 2019-08-25 18:23:35 -06:00 committed by Andreas Kling
parent 2147b587b2
commit b50ffaf7e1

View file

@ -1295,6 +1295,7 @@ GTextRange GTextEditor::find_prev(const StringView& needle, const GTextPosition&
return {};
GTextPosition position = start.is_valid() ? start : GTextPosition(0, 0);
position = prev_position_before(position);
GTextPosition original_position = position;
GTextPosition end_of_potential_match;