Skip to content

Commit aca5c36

Browse files
committed
ModuleSearcher: do case-insensitive prefix matches
Otherwise, e.g., searching for "threshold" does not prioritize "Threshold" over "Color Threshold" as intended.
1 parent 20de332 commit aca5c36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/scijava/search/module/ModuleSearcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ public List<SearchResult> search(final String text, final boolean fuzzy) {
8383

8484
// First, add modules where title starts with the text.
8585
modules.stream() //
86-
.filter(info -> ModuleSearcher.title(info).startsWith(textLower)) //
86+
.filter(info -> title(info).toLowerCase().startsWith(textLower)) //
8787
.forEach(matches::add);
8888

8989
// Next, add modules where title has text inside somewhere.
9090
modules.stream() //
91-
.filter(info -> matches(ModuleSearcher.title(info), textLower)) //
91+
.filter(info -> matches(title(info), textLower)) //
9292
.forEach(matches::add);
9393

9494
// Finally, add modules where menu path has text inside somewhere.

0 commit comments

Comments
 (0)