class Fancyline::Widget::Completion
- Fancyline::Widget::Completion
- Fancyline::Widget
- Reference
- Object
Overview
Implements the user-interaction for TAB-autocompletion. Completion
suggestions are created using the Fancyline#autocomplete
middleware.
Defined in:
fancyline/widget/completion.crConstant Summary
-
MAX_COMPLETIONS =
20
-
Hard limit of completions. More are discarded.
Instance Method Summary
- #apply_suggestion(ctx, completion)
- #completion_info_string(ctx)
- #fetch_suggestions(ctx, range, word)
-
#handle(ctx : Context, char : Char) : Bool
Called on user-input.
- #handle_control(ctx, char)
- #handle_quick_select(ctx, char)
- #move_entry(ctx, offset)
-
#start(ctx : Context)
Called when the widget is activated.
-
#stop(ctx : Context)
Called when the widget is removed.
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
Description copied from class Fancyline::Widget
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
.
Description copied from class Fancyline::Widget
Called when the widget is activated.
Description copied from class Fancyline::Widget
Called when the widget is removed.