class

Smith::UI::InputEditor

Inherits Reference < Object

The prompt's single line of input. One line on purpose: everything the agent takes is one prompt, and multi-line editing buys little here while complicating the layout. History is what makes it comfortable.

Constructors

new(history : Array(String) = Array(String).new, max_history : Int32 = 500)
Source

Instance methods

columns_before_cursor

Columns the text occupies up to (excluding) the cursor.

Source
display_width
Source
empty?
Source
handle(key : Key) : String | Nil

Handles one key. Returns the submitted text when Enter was pressed, nil otherwise.

Source
history
Source
reset
Source
text
Source