gsh/input/editor

Types

Tracks the active state of an interactive prompt session.

pub type Editor {
  Editor(
    buffer: String,
    cursor: Int,
    history: List(String),
    history_index: Int,
    saved_buffer: option.Option(String),
    menu: option.Option(String),
  )
}

Constructors

  • Editor(
      buffer: String,
      cursor: Int,
      history: List(String),
      history_index: Int,
      saved_buffer: option.Option(String),
      menu: option.Option(String),
    )

    Arguments

    buffer

    The current raw input text buffer.

    cursor

    The 1D index offset of the cursor within the input buffer string.

    history

    Chronological list of previously executed commands.

    history_index

    Current pointer index when navigating through command history (-1 when typing active input).

    saved_buffer

    Temporarily stores unsubmitted buffer state when scrolling upwards into history.

    menu

    Pre-rendered multi-column string grid containing active autocompletion suggestions.

Search Document