From b50ffaf7e1d1f3568476800c854d5b0dc00455fc Mon Sep 17 00:00:00 2001 From: Andrew Weller Date: Sun, 25 Aug 2019 18:23:35 -0600 Subject: [PATCH] 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. --- Libraries/LibGUI/GTextEditor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibGUI/GTextEditor.cpp b/Libraries/LibGUI/GTextEditor.cpp index 3b932826fc..7a42218e66 100644 --- a/Libraries/LibGUI/GTextEditor.cpp +++ b/Libraries/LibGUI/GTextEditor.cpp @@ -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;