Fix RichParser suggestion sometimes giving a different pattern/mask when specifying arguments

This commit is contained in:
dordsor21 2021-11-16 12:19:08 +00:00
parent 527b7141a3
commit cf6f54bd28
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -44,7 +44,11 @@ public abstract class RichParser<E> extends InputParser<E> implements AliasedPar
if (prefix.length() > other.length()) { if (prefix.length() > other.length()) {
return prefix.startsWith(other); return prefix.startsWith(other);
} }
int i = other.indexOf('[');
if (i == -1) {
return other.startsWith(prefix); return other.startsWith(prefix);
}
return other.substring(0, i).equalsIgnoreCase(prefix);
}; };
} }