class CryPrompt::AutoComplete

Defined in:

autocomplete.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(completion : JSON::Any | YAML::Any | Nil) #

[View source]
def self.new #

[View source]

Instance Method Detail

def box_color : Colorize::Color #

[View source]
def box_color=(box_color : Colorize::Color) #

[View source]
def box_text_background_color : Colorize::Color #

[View source]
def box_text_background_color=(box_text_background_color : Colorize::Color) #

[View source]
def box_text_foreground_color : Colorize::Color #

[View source]
def box_text_foreground_color=(box_text_foreground_color : Colorize::Color) #

[View source]
def case_sensitive : Bool #

[View source]
def case_sensitive=(case_sensitive : Bool) #

[View source]
def chose_from_render #

[View source]
def clear_line_below(current_line_index) #

dont use this just use print Keys::ClearScreenBelow


[View source]
def clear_x_below(number_of_lines, current_line_index) #

[View source]
def 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


[View source]
def 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


[View source]
def get_terminal_size #

[View source]
def print_suggestions(opts : Array(String), word : String = "", current_line_index : Int32 = 0) #

bash style single line tab suggest


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def suggestions(line : String, trie = @sugtrie) : Array(String) | Nil #

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


[View source]
def sugtrie : CryPromptTrie #

[View source]
def sugtrie=(sugtrie : CryPromptTrie) #

[View source]
def update_suggestions(completion : JSON::Any | YAML::Any = @completion, trie : CryPromptTrie = @sugtrie) #

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


[View source]