summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2020-12-24 20:28:26 +0900
committeraycabta <aycabta@gmail.com>2020-12-24 23:26:22 +0900
commit8d5d139afaf37665d2e77eeb1197e216491d805d (patch)
tree30ce83a31929f9ce51cf12f03aa5ba47bc0cdc1f
parent634b231f33d28e4048afdc643dcf14c924b98f2e (diff)
[ruby/reline] Suppress crashing when boken prompt_list is given
https://github.com/ruby/reline/commit/922d087e7a
-rw-r--r--lib/reline/line_editor.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 1ed2647..4f32f26 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -122,6 +122,7 @@ class Reline::LineEditor
mode_icon = check_mode_icon
prompt_list = prompt_list.map{ |pr| mode_icon + pr } if mode_icon
prompt = prompt_list[@line_index]
+ prompt = prompt_list[0] if prompt.nil?
prompt_width = calculate_width(prompt, true)
[prompt, prompt_width, prompt_list]
else