class Fancyline::Widget::HistorySearch

Overview

Implements a simple history search feature. Activated by hitting "Ctrl-R", then accepts non-control input, Backspace and Up/Down.

Defined in:

fancyline/widget/history_search.cr

Instance Method Summary

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

def editor : Editor | Nil #

[View source]
def editor? : Editor | Nil | Nil #

[View source]
def handle(ctx : Context, char : Char) : Bool #
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.


[View source]
def history : Fancyline::History | Nil #

[View source]
def history? : Fancyline::History | Nil | Nil #

[View source]
def move_entry(ctx, offset) #

[View source]
def needle_regex #

[View source]
def restore_original(ctx) #

[View source]
def search_prompt #

[View source]
def start(ctx : Context) #
Description copied from class Fancyline::Widget

Called when the widget is activated.


[View source]
def stop(ctx : Context) #
Description copied from class Fancyline::Widget

Called when the widget is removed.


[View source]
def update_results(ctx) #

[View source]