diff options
Diffstat (limited to 'editor/editor_help_search.cpp')
-rw-r--r-- | editor/editor_help_search.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp index 8e03c55712..d6ed2297c7 100644 --- a/editor/editor_help_search.cpp +++ b/editor/editor_help_search.cpp @@ -313,7 +313,7 @@ bool EditorHelpSearch::Runner::_slice() { } bool EditorHelpSearch::Runner::_phase_match_classes_init() { - iterator_doc = EditorHelp::get_doc_data()->class_list.front(); + iterator_doc = EditorHelp::get_doc_data()->class_list.begin(); matches.clear(); matched_item = nullptr; match_highest_score = 0; @@ -322,7 +322,7 @@ bool EditorHelpSearch::Runner::_phase_match_classes_init() { } bool EditorHelpSearch::Runner::_phase_match_classes() { - DocData::ClassDoc &class_doc = iterator_doc->value(); + DocData::ClassDoc &class_doc = iterator_doc->value; if (!_is_class_disabled_by_feature_profile(class_doc.name)) { matches[class_doc.name] = ClassMatch(); ClassMatch &match = matches[class_doc.name]; @@ -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. @@ -398,14 +401,15 @@ bool EditorHelpSearch::Runner::_phase_match_classes() { } } } + matches[class_doc.name] = match; } - iterator_doc = iterator_doc->next(); + ++iterator_doc; return !iterator_doc; } bool EditorHelpSearch::Runner::_phase_class_items_init() { - iterator_match = matches.front(); + iterator_match = matches.begin(); results_tree->clear(); root_item = results_tree->create_item(); @@ -415,7 +419,7 @@ bool EditorHelpSearch::Runner::_phase_class_items_init() { } bool EditorHelpSearch::Runner::_phase_class_items() { - ClassMatch &match = iterator_match->value(); + ClassMatch &match = iterator_match->value; if (search_flags & SEARCH_SHOW_HIERARCHY) { if (match.required()) { @@ -427,18 +431,18 @@ bool EditorHelpSearch::Runner::_phase_class_items() { } } - iterator_match = iterator_match->next(); + ++iterator_match; return !iterator_match; } bool EditorHelpSearch::Runner::_phase_member_items_init() { - iterator_match = matches.front(); + iterator_match = matches.begin(); return true; } bool EditorHelpSearch::Runner::_phase_member_items() { - ClassMatch &match = iterator_match->value(); + ClassMatch &match = iterator_match->value; TreeItem *parent = (search_flags & SEARCH_SHOW_HIERARCHY) ? class_items[match.doc->name] : root_item; bool constructor_created = false; @@ -469,7 +473,7 @@ bool EditorHelpSearch::Runner::_phase_member_items() { _create_theme_property_item(parent, match.doc, match.theme_properties[i]); } - iterator_match = iterator_match->next(); + ++iterator_match; return !iterator_match; } |