Skip to content

Commit

Permalink
Add overloaded no-arg compile method
Browse files Browse the repository at this point in the history
Before jline#1120, SystemCompleter had a no-arg compile method that
just called the StringsCompleter constructor with a Set<String>.
The StringsCompleter constructor then just created a Candidate
for each string after stripping out any ANSI characters.

This change adds a no-arg compile method does exactly the same
thing. This should make it easier for people to upgrade.
  • Loading branch information
iflan committed Dec 18, 2024
1 parent 3c63478 commit 28319c8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ private Map<String, String> getAliases() {
return aliasCommand;
}

public void compile() {
compile(s -> new Candidate(AttributedString.stripAnsi(s), s, null, null, null, null, true));
}

public void compile(Function<String, Candidate> candidateBuilder) {
if (compiled) {
return;
Expand Down

0 comments on commit 28319c8

Please sign in to comment.