diff options
author | aycabta <aycabta@gmail.com> | 2021-08-30 02:08:16 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-08-30 02:45:13 +0900 |
commit | ece4ed0da715218168e264aa7067113d48d38a3d (patch) | |
tree | a383f9ed44f04681ad0992efdcef2da8ef2b4227 /lib/irb/input-method.rb | |
parent | b6b2b767ed50cb29d7abb96ab9dcee552cc0470a (diff) | |
download | ruby-ece4ed0da715218168e264aa7067113d48d38a3d.tar.gz |
Add --autocomplete / --noautocomplete options
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r-- | lib/irb/input-method.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index 4d55e4ef3d..3dec9d0ceb 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -295,6 +295,10 @@ module IRB end end Reline.dig_perfect_match_proc = IRB::InputCompletor::PerfectMatchedProc + Reline.autocompletion = IRB.conf[:USE_AUTOCOMPLETE] + if IRB.conf[:USE_AUTOCOMPLETE] + Reline.add_dialog_proc(:show_doc, SHOW_DOC_DIALOG, Reline::DEFAULT_DIALOG_CONTEXT) + end end def check_termination(&block) @@ -361,7 +365,6 @@ module IRB Reline.output = @stdout Reline.prompt_proc = @prompt_proc Reline.auto_indent_proc = @auto_indent_proc if @auto_indent_proc - Reline.add_dialog_proc(:show_doc, SHOW_DOC_DIALOG, Reline::DEFAULT_DIALOG_CONTEXT) if l = readmultiline(@prompt, false, &@check_termination_proc) HISTORY.push(l) if !l.empty? @line[@line_no += 1] = l + "\n" |