diff options
author | aycabta <aycabta@gmail.com> | 2021-08-29 19:53:46 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-08-29 20:30:33 +0900 |
commit | 535a1cc71c1616483e4c0747d99287bdfc5ede96 (patch) | |
tree | aa35426d7a48a4ae326da1535caf50f405b788e7 /lib/reline.rb | |
parent | 74ba5328833b2033128425995b03cce4cd7a3505 (diff) |
[ruby/reline] Delete show doc dialog to move it to IRB
https://github.com/ruby/reline/commit/640102fe27
Diffstat (limited to 'lib/reline.rb')
-rw-r--r-- | lib/reline.rb | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/lib/reline.rb b/lib/reline.rb index 81d8428c09..7ec6fa2c56 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -216,48 +216,11 @@ module Reline } Reline::DEFAULT_DIALOG_CONTEXT = Array.new - require 'rdoc' - Reline::SHOW_DOC_DIALOG = ->() { - if just_cursor_moving and completion_journey_data.nil? - return nil - end - cursor_pos_to_render, result, pointer = context.pop(3) - return nil if result.nil? or pointer.nil? - name = result[pointer] - - driver = RDoc::RI::Driver.new - name = driver.expand_name name - doc = nil - used_for_class = false - if not name =~ /#|\./ - found, klasses, includes, extends = driver.classes_and_includes_and_extends_for(name) - if not found.empty? - doc = driver.class_document name, found, klasses, includes, extends - used_for_class = true - end - end - unless used_for_class - doc = RDoc::Markup::Document.new - begin - driver.add_method(doc, name) - rescue RDoc::RI::Driver::NotFoundError - doc = nil - end - end - return nil if doc.nil? - formatter = RDoc::Markup::ToAnsi.new - formatter.width = 40 - str = doc.accept(formatter) - - [Reline::CursorPos.new(cursor_pos_to_render.x + 40, cursor_pos_to_render.y + pointer), str.split("\n"), nil, '49'] - } - def readmultiline(prompt = '', add_hist = false, &confirm_multiline_termination) unless confirm_multiline_termination raise ArgumentError.new('#readmultiline needs block to confirm multiline termination') end add_dialog_proc(:autocomplete, Reline::DEFAULT_DIALOG_PROC_AUTOCOMPLETE, Reline::DEFAULT_DIALOG_CONTEXT) - add_dialog_proc(:show_doc, Reline::SHOW_DOC_DIALOG, Reline::DEFAULT_DIALOG_CONTEXT) inner_readline(prompt, add_hist, true, &confirm_multiline_termination) whole_buffer = line_editor.whole_buffer.dup |