Skip to content

Commit

Permalink
Don't suggest ##* for masks.
Browse files Browse the repository at this point in the history
  • Loading branch information
wizjany committed Jul 28, 2019
1 parent 50cea37 commit c93e5cc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ private SuggestionHelper() {

public static Stream<String> getBlockCategorySuggestions(String tag, boolean allowRandom) {
if (tag.isEmpty() || tag.equals("#")) {
return Stream.of("##", "##*");
return allowRandom ? Stream.of("##", "##*") : Stream.of("##");
}
if (tag.startsWith("##")) {
if (tag.equals("##")) {
return Stream.concat(Stream.of("##*"), getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s));
return Stream.concat(allowRandom ? Stream.of("##*") : Stream.empty(),
getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s));
} else if (tag.equals("##*") && allowRandom) {
return getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(3)).map(s -> "##*" + s);
} else {
Expand Down

0 comments on commit c93e5cc

Please sign in to comment.