Skip to content

Commit

Permalink
Merge pull request #59922 from V-Sekai/fix_editor_search
Browse files Browse the repository at this point in the history
Improve handling for editor documentation search with blank searches
  • Loading branch information
akien-mga committed Apr 5, 2022
2 parents 956189e + 208c4ce commit a8ae206
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion editor/editor_help_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,10 @@ bool EditorHelpSearch::Runner::_phase_match_classes() {

// Match class name.
if (search_flags & SEARCH_CLASSES) {
match.name = term.is_empty() || _match_string(term, class_doc.name);
// If the search term is empty, add any classes which are not script docs or which don't start with
// a double-quotation. This will ensure that only C++ classes and explictly named classes will
// be added.
match.name = (term.is_empty() && (!class_doc.is_script_doc || class_doc.name[0] != '\"')) || _match_string(term, class_doc.name);
}

// Match members if the term is long enough.
Expand Down Expand Up @@ -398,6 +401,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes() {
}
}
}
matches[class_doc.name] = match;
}

iterator_doc = iterator_doc->next();
Expand Down

0 comments on commit a8ae206

Please sign in to comment.