UI: Add slash character support to fuzzy search initials mode

Nodes with names separated by a slash / can
not be searched by their initials.

This commit adds the slash character to
the list of separators for this type of
fuzzy search.

Pull Request: https://projects.blender.org/blender/blender/pulls/106838
This commit is contained in:
zanqdo
2023-04-12 23:53:36 +02:00
committed by Daniel Salazar
parent e35f971da1
commit 2b565c6bd0

View File

@@ -346,13 +346,15 @@ void extract_normalized_words(StringRef str,
Vector<StringRef, 64> &r_words)
{
const uint32_t unicode_space = uint32_t(' ');
const uint32_t unicode_slash = uint32_t('/');
const uint32_t unicode_right_triangle = UI_MENU_ARROW_SEP_UNICODE;
BLI_assert(unicode_space == BLI_str_utf8_as_unicode(" "));
BLI_assert(unicode_slash == BLI_str_utf8_as_unicode("/"));
BLI_assert(unicode_right_triangle == BLI_str_utf8_as_unicode(UI_MENU_ARROW_SEP));
auto is_separator = [&](uint32_t unicode) {
return ELEM(unicode, unicode_space, unicode_right_triangle);
return ELEM(unicode, unicode_space, unicode_slash, unicode_right_triangle);
};
/* Make a copy of the string so that we can edit it. */