1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Check wether prompt_i is nil

This commit is contained in:
aycabta 2019-07-15 02:58:28 +09:00
parent 078e50c5e9
commit 10d7b39d5d

View file

@ -463,7 +463,8 @@ module IRB
end
if @context.auto_indent_mode and !@context.io.respond_to?(:auto_indent)
unless ltype
ind = prompt(@context.prompt_i, ltype, indent, line_no)[/.*\z/].size +
prompt_i = @context.prompt_i.nil? ? "" : @context.prompt_i
ind = prompt(prompt_i, ltype, indent, line_no)[/.*\z/].size +
indent * 2 - p.size
ind += 2 if continue
@context.io.prompt = p + " " * ind if ind > 0