summaryrefslogtreecommitdiff
path: root/lib/irb/completion.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-04-23 21:55:29 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-04-23 21:55:29 +0900
commitf4f66bd11c65882b86e0acf4d58f15fb596f25cf (patch)
tree34e6e50d15802ad6d8aab4f0d9d747efcd7c149d /lib/irb/completion.rb
parent89271d4a3733bc5e70e9c56b4bd12f277e699c42 (diff)
Revert "IRB is improved with Reline and RDoc, take 2"
Accidentally merged when 89271d4a3733bc5e70e9c56b4bd12f277e699c42 "Adjusted indents".
Diffstat (limited to 'lib/irb/completion.rb')
-rw-r--r--lib/irb/completion.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb
index 4cd9427743..390e7254dd 100644
--- a/lib/irb/completion.rb
+++ b/lib/irb/completion.rb
@@ -8,10 +8,11 @@
#
require "readline"
-require "rdoc"
module IRB
module InputCompletor # :nodoc:
+
+
# Set of reserved words used by Ruby, you should not use these for
# constants or variables
ReservedWords = %w[
@@ -34,8 +35,6 @@ module IRB
yield
]
- BASIC_WORD_BREAK_CHARACTERS = " \t\n`><=;|&{("
-
CompletionProc = proc { |input|
bind = IRB.conf[:MAIN_CONTEXT].workspace.binding
@@ -196,14 +195,6 @@ module IRB
end
}
- RDocRIDriver = RDoc::RI::Driver.new
- PerfectMatchedProc = proc { |matched|
- begin
- RDocRIDriver.display_name(matched)
- rescue RDoc::RI::Driver::NotFoundError
- end
- }
-
# Set of available operators in Ruby
Operators = %w[% & * ** + - / < << <= <=> == === =~ > >= >> [] []= ^ ! != !~]
@@ -245,3 +236,9 @@ module IRB
end
end
end
+
+if Readline.respond_to?("basic_word_break_characters=")
+ Readline.basic_word_break_characters= " \t\n`><=;|&{("
+end
+Readline.completion_append_character = nil
+Readline.completion_proc = IRB::InputCompletor::CompletionProc