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

ruby-changes:67505

From: aycabta <ko1@a...>
Date: Tue, 31 Aug 2021 20:35:16 +0900 (JST)
Subject: [ruby-changes:67505] 64373a3c58 (master): Move access to dialog_render_info inside nil check

https://git.ruby-lang.org/ruby.git/commit/?id=64373a3c58

From 64373a3c58820fd7b3313f43de2a58d8516a1c95 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Tue, 31 Aug 2021 19:36:26 +0900
Subject: Move access to dialog_render_info inside nil check

---
 lib/reline/line_editor.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 382f638..d254738 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -589,9 +589,9 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L589
     end
     dialog.set_cursor_pos(cursor_column, @first_line_started_from + @started_from)
     dialog_render_info = dialog.call
-    dialog.width = dialog_render_info.width if dialog_render_info and dialog_render_info.width
     old_dialog = dialog.clone
     if dialog_render_info and dialog_render_info.contents and not dialog_render_info.contents.empty?
+      dialog.width = dialog_render_info.width if dialog_render_info.width
       height = dialog_render_info.height || DIALOG_HEIGHT
       pointer = dialog_render_info.pointer
       dialog.contents = dialog_render_info.contents
-- 
cgit v1.1


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

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