[ruby/irb] Remove workaround for empty lines in dynamic_prompt

(https://github.com/ruby/irb/pull/884)

https://github.com/ruby/irb/commit/820b9e8dd6
This commit is contained in:
tomoya ishida 2024-02-23 21:32:55 +09:00 committed by git
parent 598b03648f
commit f0172fc7ee

View File

@ -1138,7 +1138,6 @@ module IRB
end end
if @context.io.respond_to?(:dynamic_prompt) if @context.io.respond_to?(:dynamic_prompt)
@context.io.dynamic_prompt do |lines| @context.io.dynamic_prompt do |lines|
lines << '' if lines.empty?
tokens = RubyLex.ripper_lex_without_warning(lines.map{ |l| l + "\n" }.join, local_variables: @context.local_variables) tokens = RubyLex.ripper_lex_without_warning(lines.map{ |l| l + "\n" }.join, local_variables: @context.local_variables)
line_results = IRB::NestingParser.parse_by_line(tokens) line_results = IRB::NestingParser.parse_by_line(tokens)
tokens_until_line = [] tokens_until_line = []