From 10d7b39d5d3141073221d4e53a8e81b7808a11b6 Mon Sep 17 00:00:00 2001 From: aycabta Date: Mon, 15 Jul 2019 02:58:28 +0900 Subject: Check wether prompt_i is nil --- lib/irb.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/irb.rb b/lib/irb.rb index 2b00de9f62..f9c27782b9 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -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 -- cgit v1.2.3