Skip to content

Commit

Permalink
fixing tab-completion of "last" argument
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneFuture committed Dec 21, 2023
1 parent f717192 commit 456df6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Core/src/main/java/com/plotsquared/core/command/Visit.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,22 @@ public Collection<Command> tab(PlotPlayer<?> player, String[] args, boolean spac
case 1 -> {
completions.addAll(
TabCompletions.completeAreas(args[1]));
completions.addAll(TabCompletions.asCompletions("last"));
if (args[1].isEmpty()) {
// if no input is given, only suggest 1 - 3
completions.addAll(
TabCompletions.asCompletions("1", "2", "3", "last"));
TabCompletions.asCompletions("1", "2", "3"));
break;
}
completions.addAll(
TabCompletions.completeNumbers(args[1], 10, 999));
}
case 2 -> {
completions.addAll(TabCompletions.asCompletions("last"));
if (args[2].isEmpty()) {
// if no input is given, only suggest 1 - 3
completions.addAll(
TabCompletions.asCompletions("1", "2", "3", "last"));
TabCompletions.asCompletions("1", "2", "3"));
break;
}
completions.addAll(
Expand Down

0 comments on commit 456df6b

Please sign in to comment.