class Fancyline::Widget::History
- Fancyline::Widget::History
- Fancyline::Widget
- Reference
- Object
Overview
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::DEFAULT
s handler for Key::Control::Up
.
Defined in:
fancyline/widget/history.crInstance Method Summary
-
#handle(ctx : Context, char : Char) : Bool
Handles user input.
-
#history : Fancyline::History | Nil
The history we're operating on.
-
#history? : Fancyline::History | Nil | Nil
The history we're operating on.
-
#show_entry(ctx, offset)
Shows a history entry, moving in it by offset entries.
-
#start(ctx : Context)
Starts the widget.
Instance methods inherited from class Fancyline::Widget
handle(ctx : Context, char : Char) : Bool
handle,
start(ctx : Context)
start,
stop(ctx : Context)
stop
Instance Method Detail
Handles user input. Called by Fancyline::Context#handle
.
def history? : Fancyline::History | Nil | Nil
#
The history we're operating on. Initialized in #start
.