From 50cea37439ed048f0a28e14535fb855987aef027 Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Sat, 27 Jul 2019 23:49:11 -0700 Subject: [PATCH] Fix other minor suggestion bugs --- .../com/sk89q/worldedit/command/util/SuggestionHelper.java | 2 +- .../main/java/com/sk89q/worldedit/fabric/CommandWrapper.java | 3 ++- .../main/java/com/sk89q/worldedit/forge/CommandWrapper.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java index e0014ee56..3a41711b6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/SuggestionHelper.java @@ -51,7 +51,7 @@ public final class SuggestionHelper { if (tag.isEmpty() || tag.equals("#")) { return Stream.of("##", "##*"); } - if (tag.startsWith("#")) { + if (tag.startsWith("##")) { if (tag.equals("##")) { return Stream.concat(Stream.of("##*"), getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s)); } else if (tag.equals("##*") && allowRandom) { diff --git a/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/CommandWrapper.java b/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/CommandWrapper.java index 8efa5ce97..462975acb 100644 --- a/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/CommandWrapper.java +++ b/worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/CommandWrapper.java @@ -111,7 +111,8 @@ public final class CommandWrapper { // Ensure there is a space! if (suggestion.getStart() == suggestion.getEnd() && suggestion.getEnd() == builder.getInput().length() - && !builder.getInput().endsWith(" ")) { + && !builder.getInput().endsWith(" ") + && !builder.getInput().endsWith("\"")) { suggestionText = " " + suggestionText; } result.add(new Suggestion( diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java index 05d4fe5ad..0cf62fb4b 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/CommandWrapper.java @@ -103,7 +103,8 @@ public final class CommandWrapper { // Ensure there is a space! if (suggestion.getStart() == suggestion.getEnd() && suggestion.getEnd() == builder.getInput().length() - && !builder.getInput().endsWith(" ")) { + && !builder.getInput().endsWith(" ") + && !builder.getInput().endsWith("\"")) { suggestionText = " " + suggestionText; } result.add(new Suggestion(