[ruby/irb] Require Reline 0.3.6 or higher
(https://github.com/ruby/irb/pull/632) * Require Reline 0.3.6 or higher "Multi-line multibyte regular expression raises exception" (https://github.com/ruby/irb/issues/627) is fixed in Reline 0.3.6. * Remove unnecessary conditional
This commit is contained in:
parent
e770006486
commit
4be92463b6
@ -268,9 +268,7 @@ module IRB
|
|||||||
@stdin = ::IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
|
@stdin = ::IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
|
||||||
@stdout = ::IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
|
@stdout = ::IO.open(STDOUT.to_i, 'w', :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
|
||||||
|
|
||||||
if Reline.respond_to?("basic_word_break_characters=")
|
|
||||||
Reline.basic_word_break_characters = IRB::InputCompletor::BASIC_WORD_BREAK_CHARACTERS
|
Reline.basic_word_break_characters = IRB::InputCompletor::BASIC_WORD_BREAK_CHARACTERS
|
||||||
end
|
|
||||||
Reline.completion_append_character = nil
|
Reline.completion_append_character = nil
|
||||||
Reline.completer_quote_characters = ''
|
Reline.completer_quote_characters = ''
|
||||||
Reline.completion_proc = IRB::InputCompletor::CompletionProc
|
Reline.completion_proc = IRB::InputCompletor::CompletionProc
|
||||||
@ -399,7 +397,7 @@ module IRB
|
|||||||
mod_key = RUBY_PLATFORM.match?(/darwin/) ? "Option" : "Alt"
|
mod_key = RUBY_PLATFORM.match?(/darwin/) ? "Option" : "Alt"
|
||||||
message = "Press #{mod_key}+d to read the full document"
|
message = "Press #{mod_key}+d to read the full document"
|
||||||
contents = [message] + doc.accept(formatter).split("\n")
|
contents = [message] + doc.accept(formatter).split("\n")
|
||||||
contents = contents.take(Reline.preferred_dialog_height) if Reline.respond_to?(:preferred_dialog_height)
|
contents = contents.take(Reline.preferred_dialog_height)
|
||||||
|
|
||||||
y = cursor_pos_to_render.y
|
y = cursor_pos_to_render.y
|
||||||
Reline::DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')
|
Reline::DialogRenderInfo.new(pos: Reline::CursorPos.new(x, y), contents: contents, width: width, bg_color: '49')
|
||||||
@ -456,11 +454,7 @@ module IRB
|
|||||||
def inspect
|
def inspect
|
||||||
config = Reline::Config.new
|
config = Reline::Config.new
|
||||||
str = "RelineInputMethod with Reline #{Reline::VERSION}"
|
str = "RelineInputMethod with Reline #{Reline::VERSION}"
|
||||||
if config.respond_to?(:inputrc_path)
|
|
||||||
inputrc_path = File.expand_path(config.inputrc_path)
|
inputrc_path = File.expand_path(config.inputrc_path)
|
||||||
else
|
|
||||||
inputrc_path = File.expand_path(ENV['INPUTRC'] || '~/.inputrc')
|
|
||||||
end
|
|
||||||
str += " and #{inputrc_path}" if File.exist?(inputrc_path)
|
str += " and #{inputrc_path}" if File.exist?(inputrc_path)
|
||||||
str
|
str
|
||||||
end
|
end
|
||||||
|
@ -41,5 +41,5 @@ Gem::Specification.new do |spec|
|
|||||||
|
|
||||||
spec.required_ruby_version = Gem::Requirement.new(">= 2.7")
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7")
|
||||||
|
|
||||||
spec.add_dependency "reline", ">= 0.3.0"
|
spec.add_dependency "reline", ">= 0.3.6"
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user