[前][次][番号順一覧][スレッド一覧]

ruby-changes:64567

From: aycabta <ko1@a...>
Date: Thu, 24 Dec 2020 23:32:39 +0900 (JST)
Subject: [ruby-changes:64567] 8d5d139afa (master): [ruby/reline] Suppress crashing when boken prompt_list is given

https://git.ruby-lang.org/ruby.git/commit/?id=8d5d139afa

From 8d5d139afaf37665d2e77eeb1197e216491d805d Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Thu, 24 Dec 2020 20:28:26 +0900
Subject: [ruby/reline] Suppress crashing when boken prompt_list is given

https://github.com/ruby/reline/commit/922d087e7a

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 https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L122
       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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]