13
0
geforkt von Mirrors/Velocity

Fix up console tab-completion again.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-10-25 01:42:57 -04:00
Ursprung 6c27ac9576
Commit a98fcc28fe

Datei anzeigen

@ -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<List<String>> o = this.server.getCommandManager().offerSuggestions(this, parsedLine.line());
o.ifPresent(offers -> {
for (String offer : offers) {
if (isCommand) {
list.add(new Candidate(offer.substring(1)));
} else {
list.add(new Candidate(offer));
}
}
});
} catch (Exception e) {