class

Fancyline::Widget::History

Inherits Fancyline::Widget / Reference / Object

Implements a simple history access feature. Activated by hitting the "Up" key, then accepts "Up" and "Down" to navigate the history.

The source code of this widget has exhaustive commentary, which hopefully makes this useful to you, the reader, for studying! It's put to use in KeyAction::DEFAULTs handler for Key::Control::Up.

Instance methods

handle(ctx : Context, char : Char) : Bool

Handles user input. Called by Fancyline::Context#handle.

Source
history

The history we're operating on. Initialized in #start.

Source
history?

The history we're operating on. Initialized in #start.

Source
show_entry(ctx, offset)

Shows a history entry, moving in it by offset entries.

Source
start(ctx : Context)

Starts the widget.

Source