summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-07-15 02:58:28 +0900
committeraycabta <aycabta@gmail.com>2019-07-15 02:58:28 +0900
commit10d7b39d5d3141073221d4e53a8e81b7808a11b6 (patch)
treed51dd1cde59e3265d05ac9860d647d055c3a03c7
parent078e50c5e9c53d935bdea6ca3ae156c0edcea467 (diff)
Check wether prompt_i is nil
-rw-r--r--lib/irb.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index 2b00de9..f9c2778 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