mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
GTextEditor: Fix obvious bug in find()
We forgot to rewind the search cursor after a partial match, which would make us fail to find "xxy" in "xxxxy".
This commit is contained in:
parent
1ca6adee90
commit
748b38d80f
Notes:
sideshowbarker
2024-07-19 12:33:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/748b38d80f3
1 changed files with 2 additions and 0 deletions
|
@ -1125,6 +1125,8 @@ GTextRange GTextEditor::find(const StringView& needle, const GTextPosition& star
|
|||
if (needle_index >= needle.length())
|
||||
return { start_of_potential_match, next_position_after(position) };
|
||||
} else {
|
||||
if (needle_index > 0)
|
||||
position = start_of_potential_match;
|
||||
needle_index = 0;
|
||||
}
|
||||
position = next_position_after(position);
|
||||
|
|
Loading…
Reference in a new issue