13
0
geforkt von Mirrors/Velocity

Also make sure tab list completion doesn't crash the proxy

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-10-12 22:12:15 -04:00
Ursprung 1f329b09f3
Commit 2f0ba42fa0

Datei anzeigen

@ -51,12 +51,16 @@ public final class VelocityConsole extends SimpleTerminalConsole implements Comm
return super.buildReader(builder
.appName("Velocity")
.completer((reader, parsedLine, list) -> {
Optional<List<String>> o = this.server.getCommandManager().offerSuggestions(this, parsedLine.line());
o.ifPresent(offers -> {
for (String offer : offers) {
list.add(new Candidate(offer));
}
});
try {
Optional<List<String>> o = this.server.getCommandManager().offerSuggestions(this, parsedLine.line());
o.ifPresent(offers -> {
for (String offer : offers) {
list.add(new Candidate(offer));
}
});
} catch (Exception e) {
logger.error("An error occurred while trying to perform tab completion.", e);
}
})
);
}