mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-14 11:45:04 +00:00
LibGUI: Move text search functions from GTextEditor to GTextDocument
Also add a find_all() that retuns a Vector<GTextRange> and simply does a find_next() loop, returning all the matching ranges.
This commit is contained in:
@@ -50,7 +50,7 @@ TextEditorWidget::TextEditorWidget()
|
||||
dbg() << "find_next(\"\")";
|
||||
return;
|
||||
}
|
||||
auto found_range = m_editor->find_next(needle, m_editor->normalized_selection().end());
|
||||
auto found_range = m_editor->document().find_next(needle, m_editor->normalized_selection().end());
|
||||
dbg() << "find_next(\"" << needle << "\") returned " << found_range;
|
||||
if (found_range.is_valid()) {
|
||||
m_editor->set_selection(found_range);
|
||||
@@ -73,7 +73,7 @@ TextEditorWidget::TextEditorWidget()
|
||||
if (!selection_start.is_valid())
|
||||
selection_start = m_editor->normalized_selection().end();
|
||||
|
||||
auto found_range = m_editor->find_prev(needle, selection_start);
|
||||
auto found_range = m_editor->document().find_previous(needle, selection_start);
|
||||
|
||||
dbg() << "find_prev(\"" << needle << "\") returned " << found_range;
|
||||
if (found_range.is_valid()) {
|
||||
|
||||
Reference in New Issue
Block a user