From a98fcc28fee57211f2a80ebcba81e8b87a47ae78 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 25 Oct 2018 01:42:57 -0400 Subject: [PATCH] Fix up console tab-completion again. --- .../com/velocitypowered/proxy/console/VelocityConsole.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/console/VelocityConsole.java b/proxy/src/main/java/com/velocitypowered/proxy/console/VelocityConsole.java index 95af6d2a1..c3aff7c58 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/console/VelocityConsole.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/console/VelocityConsole.java @@ -52,10 +52,15 @@ public final class VelocityConsole extends SimpleTerminalConsole implements Comm .appName("Velocity") .completer((reader, parsedLine, list) -> { try { + boolean isCommand = parsedLine.line().indexOf(' ') == -1; Optional> o = this.server.getCommandManager().offerSuggestions(this, parsedLine.line()); o.ifPresent(offers -> { for (String offer : offers) { - list.add(new Candidate(offer.substring(1))); + if (isCommand) { + list.add(new Candidate(offer.substring(1))); + } else { + list.add(new Candidate(offer)); + } } }); } catch (Exception e) {