class Reline::LineEditor
def incremental_search_history(key)
def incremental_search_history(key) @history_pointer is_multiline ine_backup_in_history = whole_buffer ine_backup_in_history = @line er = generate_searcher er.resume(key) hing_prompt = "(reverse-i-search)`': " ation_keys = ["\C-j".ord] ation_keys.concat(@config.isearch_terminators&.chars&.map(&:ord)) if @config.isearch_terminators ng_proc = ->(k) { k *termination_keys @history_pointer buffer = Reline::HISTORY[@history_pointer] se buffer = @line_backup_in_history d @is_multiline @buffer_of_lines = buffer.split("\n") @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty? @line_index = @buffer_of_lines.size - 1 @line = @buffer_of_lines.last @rerender_all = true se @line = buffer d earching_prompt = nil aiting_proc = nil ursor_max = calculate_width(@line) ursor = @byte_pointer = 0 erender_all = true ached_prompt_list = nil archer.resume(-1) "\C-g".ord @is_multiline @buffer_of_lines = @line_backup_in_history.split("\n") @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty? @line_index = @buffer_of_lines.size - 1 @line = @buffer_of_lines.last @rerender_all = true se @line = @line_backup_in_history d istory_pointer = nil earching_prompt = nil aiting_proc = nil ine_backup_in_history = nil ursor_max = calculate_width(@line) ursor = @byte_pointer = 0 erender_all = true r = k.is_a?(String) ? k : k.chr(Encoding::ASCII_8BIT) chr.match?(/[[:print:]]/) or k == "\C-h".ord or k == "\C-?".ord or k == "\C-r".ord or k == "\C-s".ord searcher.resume(k) se if @history_pointer line = Reline::HISTORY[@history_pointer] else line = @line_backup_in_history end if @is_multiline @line_backup_in_history = whole_buffer @buffer_of_lines = line.split("\n") @buffer_of_lines = [String.new(encoding: @encoding)] if @buffer_of_lines.empty? @line_index = @buffer_of_lines.size - 1 @line = @buffer_of_lines.last @rerender_all = true else @line_backup_in_history = @line @line = line end @searching_prompt = nil @waiting_proc = nil @cursor_max = calculate_width(@line) @cursor = @byte_pointer = 0 @rerender_all = true @cached_prompt_list = nil searcher.resume(-1) d