这是我的Java代码。
public class CompletionTest {
public static void main(String[] args) throws IOException {
ConsoleReader console = new ConsoleReader();
Completer nil = new NullCompleter();
Completer read = new StringsCompleter("read");
Completer and = new StringsCompleter("and");
Completer save = new StringsCompleter("save");
Completer aggregator = new AggregateCompleter(
new ArgumentCompleter(read, and, save, nil)
);
console.addCompleter(aggregator);
while (console.readLine() != null) {
console.println();
}
}
}
如果我完成输入,如下面的代码段
read an[TAB]d
然后返回将光标设置为
read a[cursor is here]nd
然后按TAB,我预计不会完成
read and d
是JLine2库的错误或预期行为吗?