Package org.daiitech.naftah.utils.repl
Class NaftahStringsCompleter
java.lang.Object
org.jline.reader.impl.completer.StringsCompleter
org.daiitech.naftah.utils.repl.NaftahStringsCompleter
- All Implemented Interfaces:
org.jline.reader.Completer
public class NaftahStringsCompleter
extends org.jline.reader.impl.completer.StringsCompleter
A custom
StringsCompleter implementation that supports shaping text
for better display in terminals that require right-to-left formatting.
This completer processes a collection of strings and optionally reshapes them using a utility method (e.g., for contextual script display).
Each input string is added as a Candidate, with reshaping applied if necessary.
ANSI escape codes are stripped from the completion value but not the display value.
- Author:
- Chakib Daii
-
Field Summary
Fields inherited from class org.jline.reader.impl.completer.StringsCompleter
candidates, stringsSupplier -
Constructor Summary
ConstructorsConstructorDescriptionNaftahStringsCompleter(Iterable<String> strings) Constructs a newNaftahStringsCompleterusing the given iterable of strings. -
Method Summary
Methods inherited from class org.jline.reader.impl.completer.StringsCompleter
complete, toString
-
Constructor Details
-
NaftahStringsCompleter
Constructs a newNaftahStringsCompleterusing the given iterable of strings. If text shaping is enabled, each string will be reshaped for display.- Parameters:
strings- an iterable collection of string candidates for completion (must not benull)- Throws:
AssertionError- ifstringsisnull
-