Module: Reline
- Extended by:
- Forwardable, SingleForwardable
- Defined in:
- lib/reline.rb,
lib/reline/version.rb
Defined Under Namespace
Modules: KeyActor, Terminfo
Classes: ANSI, Config, ConfigEncodingConversionError, Core, CursorPos, DialogRenderInfo, GeneralIO, History, Key, KeyStroke, KillRing, LineEditor, Unicode, Windows
Constant Summary
collapse
- FILENAME_COMPLETION_PROC =
nil
- USERNAME_COMPLETION_PROC =
nil
- DEFAULT_DIALOG_PROC_AUTOCOMPLETE =
->() {
return nil unless config.autocompletion
if just_cursor_moving and completion_journey_data.nil?
return nil
end
pre, target, post = retrieve_completion_block(true)
if target.nil? or target.empty? or (completion_journey_data&.pointer == -1 and target.size <= 3)
return nil
end
if completion_journey_data and completion_journey_data.list
result = completion_journey_data.list.dup
result.shift
pointer = completion_journey_data.pointer - 1
else
result = call_completion_proc_with_checking_args(pre, target, post)
pointer = nil
end
if result and result.size == 1 and result[0] == target and pointer != 0
result = nil
end
target_width = Reline::Unicode.calculate_width(target)
x = cursor_pos.x - target_width
if x < 0
x = screen_width + x
y = -1
else
y = 0
end
cursor_pos_to_render = Reline::CursorPos.new(x, y)
if context and context.is_a?(Array)
context.clear
context.push(cursor_pos_to_render, result, pointer, dialog)
end
dialog.pointer = pointer
DialogRenderInfo.new(pos: cursor_pos_to_render, contents: result, scrollbar: true, height: 15)
}
- DEFAULT_DIALOG_CONTEXT =
Array.new
- IOGate =
if $stdout.isatty
require 'reline/ansi'
Reline::ANSI
else
Reline::GeneralIO
end
- HISTORY =
Reline::History.new(Reline.core.config)
- VERSION =
'0.3.1'
Class Method Summary
collapse
Class Method Details
.encoding_system_needs ⇒ Object
536
537
538
|
# File 'lib/reline.rb', line 536
def self.encoding_system_needs
self.core.encoding
end
|
.insert_text(*args, &block) ⇒ Object
517
518
519
520
|
# File 'lib/reline.rb', line 517
def self.insert_text(*args, &block)
line_editor.insert_text(*args, &block)
self
end
|
.line_editor ⇒ Object
560
561
562
|
# File 'lib/reline.rb', line 560
def self.line_editor
core.line_editor
end
|
.ungetc(c) ⇒ Object
556
557
558
|
# File 'lib/reline.rb', line 556
def self.ungetc(c)
Reline::IOGate.ungetc(c)
end
|