mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Match current command input for sub argument tab completions (#3496)
This commit is contained in:
parent
78c7f03923
commit
2c6e18e4fe
@ -125,7 +125,15 @@ public abstract class ViaCommandHandler implements ViaVersionCommand {
|
||||
|
||||
List<String> tab = sub.onTabComplete(sender, subArgs);
|
||||
Collections.sort(tab);
|
||||
return tab;
|
||||
if (!tab.isEmpty()) {
|
||||
final String currArg = subArgs[subArgs.length - 1];
|
||||
for (String s : tab) {
|
||||
if (s.toLowerCase(Locale.ROOT).startsWith(currArg.toLowerCase(Locale.ROOT))) {
|
||||
output.add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
return output;
|
||||
|
@ -71,7 +71,6 @@ public class DebugSubCmd extends ViaSubCommand {
|
||||
@Override
|
||||
public List<String> onTabComplete(final ViaCommandSender sender, final String[] args) {
|
||||
if (args.length == 1) {
|
||||
//TODO match current input
|
||||
return Arrays.asList("clear", "logposttransform", "add", "remove");
|
||||
}
|
||||
return Collections.emptyList();
|
||||
|
Loading…
Reference in New Issue
Block a user