class EditingSession
source · line 23public class EditingSession public constructor(
public val config: Config = readlineConfig(),
public val history: History = FileHistory(config),
initial: String = "",
cursor: Long = initial.charLength,
public val completer: Completer = NoCompleter,
public val hinter: Hinter = NoHinter,
public val highlighter: Highlighter = PlainHighlighter,
public val validator: Validator = AcceptAll
)
The production editor core, driven by terminal events or application-provided events.
property completer
source · line 28public val completer: Completer = NoCompleter
get: public read-only
function bindSequence
source · line 90public fun bindSequence(keys: Array<KeyEvent>, handler: (LineBuffer, Context) -> Command): Unit
Installs an ordered key sequence with an application-selected command.
parameter keys
source · line 90keys: Array<KeyEvent>
parameter handler
source · line 90handler: (LineBuffer, Context) -> Command
property hint
source · line 65public val hint: Hint?
get: public read-only
getter get
source · line 65get(): Option<Hint>
property line
source · line 57public val line: String
get: public read-only
getter get
source · line 57get(): String
function takeBell
source · line 300public fun takeBell(): Boolean
Consumes pending bell feedback.
property viMode
source · line 60public val viMode: ViMode
get: public read-only
getter get
source · line 60get(): ViMode
property context
source · line 64public val context: Context
get: public read-only
getter get
source · line 64get(): Context
property cursor
source · line 58public val cursor: Long
get: public read-only
getter get
source · line 58get(): Long
property historyIndex
source · line 59public val historyIndex: Long
get: public read-only
getter get
source · line 59get(): Long
property highlighter
source · line 30public val highlighter: Highlighter = PlainHighlighter
get: public read-only
property config
source · line 24public val config: Config = readlineConfig()
get: public read-only
constructor constructor
source · line 23constructor(public val config: Config = readlineConfig(), public val history: History = FileHistory(config), initial: String = "", cursor: Long = initial.charLength, public val completer: Completer = NoCompleter, public val hinter: Hinter = NoHinter, public val highlighter: Highlighter = PlainHighlighter, public val validator: Validator = AcceptAll)
parameter hinter
source · line 29public val hinter: Hinter = NoHinter
parameter cursor
source · line 27cursor: Long = initial.charLength
parameter completer
source · line 28public val completer: Completer = NoCompleter
parameter history
source · line 25public val history: History = FileHistory(config)
parameter config
source · line 24public val config: Config = readlineConfig()
parameter validator
source · line 31public val validator: Validator = AcceptAll
parameter initial
source · line 26initial: String = ""
parameter highlighter
source · line 30public val highlighter: Highlighter = PlainHighlighter
function unbindSequence
source · line 105public fun unbindSequence(keys: Array<KeyEvent>): Boolean
Removes an exact custom key sequence, returning whether it was present.
parameter keys
source · line 105keys: Array<KeyEvent>
property candidates
source · line 62public val candidates: Array<Candidate>
get: public read-only
getter get
source · line 62get(): Array<Candidate>
property message
source · line 61public val message: String?
get: public read-only
getter get
source · line 61get(): Option<String>
function flushPendingSequence
source · line 177public fun flushPendingSequence(): EditResult
Resolves an incomplete custom sequence through the normal key map after its timeout.
function execute
source · line 235public fun execute(command: Command): EditResult
Executes a command using exactly the same path as keyboard input.
parameter command
source · line 235command: Command
function handle
source · line 108public fun handle(event: Event): EditResult
Processes a terminal event, preserving edit state across resize and paste events.
parameter event
source · line 108event: Event
property history
source · line 25public val history: History = FileHistory(config)
get: public read-only
property hasPendingSequence
source · line 63public val hasPendingSequence: Boolean
get: public read-only
getter get
source · line 63get(): Boolean
function bind
source · line 86public fun bind(key: KeyEvent, command: Command): Unit
Installs or replaces a literal key binding; key release events never trigger bindings.
parameter key
source · line 86key: KeyEvent
parameter command
source · line 86command: Command
function takeClearScreen
source · line 306public fun takeClearScreen(): Boolean
Consumes a request to clear the screen.
property hinter
source · line 29public val hinter: Hinter = NoHinter
get: public read-only
property buffer
source · line 33public val buffer: LineBuffer
get: public read-only
property validator
source · line 31public val validator: Validator = AcceptAll
get: public read-only