1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

LibGUI: Add match_case parameter to TextDocument::find_all()

This commit is contained in:
Itamar 2022-03-29 16:32:12 +03:00 committed by Andreas Kling
parent ab0b4f46f7
commit a12385dc4b
2 changed files with 3 additions and 3 deletions

View file

@ -580,13 +580,13 @@ TextRange TextDocument::find_previous(StringView needle, const TextPosition& sta
return {}; return {};
} }
Vector<TextRange> TextDocument::find_all(StringView needle, bool regmatch) Vector<TextRange> TextDocument::find_all(StringView needle, bool regmatch, bool match_case)
{ {
Vector<TextRange> ranges; Vector<TextRange> ranges;
TextPosition position; TextPosition position;
for (;;) { for (;;) {
auto range = find_next(needle, position, SearchShouldWrap::No, regmatch); auto range = find_next(needle, position, SearchShouldWrap::No, regmatch, match_case);
if (!range.is_valid()) if (!range.is_valid())
break; break;
ranges.append(range); ranges.append(range);

View file

@ -89,7 +89,7 @@ public:
String text() const; String text() const;
String text_in_range(const TextRange&) const; String text_in_range(const TextRange&) const;
Vector<TextRange> find_all(StringView needle, bool regmatch = false); Vector<TextRange> find_all(StringView needle, bool regmatch = false, bool match_case = true);
void update_regex_matches(StringView); void update_regex_matches(StringView);
TextRange find_next(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true); TextRange find_next(StringView, const TextPosition& start = {}, SearchShouldWrap = SearchShouldWrap::Yes, bool regmatch = false, bool match_case = true);