Skip to content

Commit bca71e1

Browse files
authored
Merge pull request #3367 from Multiverse/fix/tab-complete-quotes
Quote multi-word strings for all tab-completion
2 parents d34f3ad + 343da8c commit bca71e1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/org/mvplugins/multiverse/core/command/MVCommandCompletions.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,16 @@ private Collection<String> suggestMVWorlds(BukkitCommandCompletionContext contex
279279
case "both" -> {
280280
return worldManager.getWorlds().stream()
281281
.map(MultiverseWorld::getTabCompleteName)
282-
.map(StringFormatter::quoteMultiWordString)
283282
.toList();
284283
}
285284
case "loaded" -> {
286285
return worldManager.getLoadedWorlds().stream()
287286
.map(MultiverseWorld::getTabCompleteName)
288-
.map(StringFormatter::quoteMultiWordString)
289287
.toList();
290288
}
291289
case "unloaded" -> {
292290
return worldManager.getUnloadedWorlds().stream()
293291
.map(MultiverseWorld::getTabCompleteName)
294-
.map(StringFormatter::quoteMultiWordString)
295292
.toList();
296293
}
297294
case "potential" -> {

src/main/java/org/mvplugins/multiverse/core/command/MVRootCommand.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public BaseCommand execute(CommandIssuer sender, String commandLabel, String[] a
2222
@Override
2323
public List<String> getTabCompletions(CommandIssuer sender, String alias, String[] args, boolean commandsOnly, boolean isAsync) {
2424
String[] quoteFormatedArgs = StringFormatter.parseQuotesInArgs(args).toArray(String[]::new);
25-
return super.getTabCompletions(sender, alias, quoteFormatedArgs, commandsOnly, isAsync);
25+
return super.getTabCompletions(sender, alias, quoteFormatedArgs, commandsOnly, isAsync)
26+
.stream()
27+
.map(StringFormatter::quoteMultiWordString)
28+
.toList();
2629
}
2730
}

0 commit comments

Comments
 (0)