diff options
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r-- | lib/irb/input-method.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index cef65b7162..94ad28cd63 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -193,6 +193,10 @@ module IRB } end + def completion_info + 'RegexpCompletor' + end + # Reads the next line from this input method. # # See IO#gets for more information. @@ -230,13 +234,13 @@ module IRB HISTORY = Reline::HISTORY include HistorySavingAbility # Creates a new input method object using Reline - def initialize + def initialize(completor) IRB.__send__(:set_encoding, Reline.encoding_system_needs.name, override: false) - super + super() @eof = false - @completor = RegexpCompletor.new + @completor = completor Reline.basic_word_break_characters = BASIC_WORD_BREAK_CHARACTERS Reline.completion_append_character = nil @@ -270,6 +274,11 @@ module IRB end end + def completion_info + autocomplete_message = Reline.autocompletion ? 'Autocomplete' : 'Tab Complete' + "#{autocomplete_message}, #{@completor.inspect}" + end + def check_termination(&block) @check_termination_proc = block end |