Skip to content

Commit

Permalink
Add overloaded no-arg compile method (#1137)
Browse files Browse the repository at this point in the history
Before #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 authored Dec 22, 2024
1 parent 8087827 commit 7213863
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 7213863

Please sign in to comment.