Skip to content

Commit

Permalink
Match parentcategories when searching for a subcategory
Browse files Browse the repository at this point in the history
  • Loading branch information
nea89o committed Nov 16, 2023
1 parent f130789 commit 6742371
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ public void updateSearchResults(boolean recalculateOptionUniverse) {
currentlyVisibleOptions = matchingOptionsAndDependencies;

Set<ProcessedCategory> visibleCategories = matchingOptionsAndDependencies.stream().map(it -> it.category).collect(Collectors.toSet());
Set<ProcessedCategory> parentCategories = visibleCategories.stream()
.filter(it -> it.parent != null).map(it -> processedConfig.getAllCategories().get(it.parent))
.filter(Objects::nonNull).collect(Collectors.toSet());
visibleCategories.addAll(parentCategories);
LinkedHashMap<String, ProcessedCategory> matchingCategories = new LinkedHashMap<>(processedConfig.getAllCategories());
matchingCategories.entrySet().removeIf(stringProcessedCategoryEntry -> !visibleCategories.contains(stringProcessedCategoryEntry.getValue()));
currentlyVisibleCategories = matchingCategories;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ public class SubCategory {
)
@ConfigEditorBoolean
public boolean w = false;
@ConfigOption(
name = "EICAR",
desc = "com"
)
@ConfigEditorBoolean
public boolean we = false;
}

0 comments on commit 6742371

Please sign in to comment.