class

CryPrompt::AutoComplete

Inherits Reference / Object

Constructors

new(completion : JSON::Any | YAML::Any | Nil)
Source

Instance methods

box_color
Source
box_color=(box_color : Colorize::Color)
Source
box_text_background_color
Source
box_text_background_color=(box_text_background_color : Colorize::Color)
Source
box_text_foreground_color
Source
box_text_foreground_color=(box_text_foreground_color : Colorize::Color)
Source
case_sensitive
Source
case_sensitive=(case_sensitive : Bool)
Source
chose_from_render
Source
clear_line_below(current_line_index)

dont use this just use print Keys::ClearScreenBelow

Source
clear_x_below(number_of_lines, current_line_index)
Source
completion

load a yaml or json hash to parse from you still need to call update_suggestions to parse it

Source
completion=(completion : JSON::Any | YAML::Any | Nil)

load a yaml or json hash to parse from you still need to call update_suggestions to parse it

Source
get_terminal_size
Source
render(opts : Array(CryPromptTrie), current_line_index, word, tabc = -1, prompt_size = 2, line_size = 0)

will render a suggestion box just below the word the person is typing

Source
render_box(opts : Array(String), selected_index : Int32 = -1, max_suggested : Int32 = 5, min_width_size : Int32 = 4)

NOT WORKING (probably due to scos/rc) draws the box with the suggestions in it. selected_index is the index in opts that will be selected to be highlighted max_size is the width of the box max_suggested is how many items will be suggested at the maximum

Source
suggestion_nodes(line : String, trie = @sugtrie) : Array(CryPromptTrie) | Nil

returns an array of words from the sugtrie that fall in line with the given line

Source
suggestions(line : String, trie = @sugtrie) : Array(String) | Nil

returns an array of words from the sugtrie that fall in line with the given line

Source
sugtrie
Source
sugtrie=(sugtrie : CryPromptTrie)
Source
update_suggestions(completion : JSON::Any | YAML::Any = @completion, trie : CryPromptTrie = @sugtrie)

recursive function to generate the suggestion trie from a json or yaml structure

Source