Skip to content

Commit

Permalink
fix bugs in autocompletion when there is invalid input
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Sep 23, 2024
1 parent 928d781 commit 24dbf66
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ private List<String> complete(ExecutableCommand<A> possible, MutableStringStream
if (consumed.contains(" ")) {
return filterWithSpaces(parameter.complete(actor, input, context), consumed);
}
if (input.canRead(consumed.length() + 1) && input.peekOffset(consumed.length()) == ' ') {
input.read(consumed.length());
continue;
}
return filter(parameter.complete(actor, input, context), s -> startsWithIgnoreCase(s, consumed));
}
}
Expand Down

0 comments on commit 24dbf66

Please sign in to comment.