class

Fancyline::Widget::Completion

Inherits Fancyline::Widget / Reference / Object

Implements the user-interaction for TAB-autocompletion. Completion suggestions are created using the Fancyline#autocomplete middleware.

Constants

MAX_COMPLETIONS = 20

Hard limit of completions. More are discarded.

Instance methods

apply_suggestion(ctx, completion)
Source
completion_info_string(ctx)
Source
fetch_suggestions(ctx, range, word)
Source
handle(ctx : Context, char : Char) : Bool

Called on user-input. Return true if you handeled the input, return false to handle it as normal input by the Context.

The default implementation calls Context#stop_widget to remove itself, and returns false.

Source
handle_control(ctx, char)
Source
handle_quick_select(ctx, char)
Source
move_entry(ctx, offset)
Source
start(ctx : Context)

Called when the widget is activated.

Source
stop(ctx : Context)

Called when the widget is removed.

Source