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

    Constructors
    Constructor
    Description
    Constructs a new NaftahStringsCompleter using the given iterable of strings.
  • Method Summary

    Methods inherited from class org.jline.reader.impl.completer.StringsCompleter

    complete, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NaftahStringsCompleter

      public NaftahStringsCompleter(Iterable<String> strings)
      Constructs a new NaftahStringsCompleter using 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 be null)
      Throws:
      AssertionError - if strings is null