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

ruby-changes:67566

From: aycabta <ko1@a...>
Date: Fri, 3 Sep 2021 03:32:22 +0900 (JST)
Subject: [ruby-changes:67566] f3fe3511da (master): [ruby/reline] Swap the order of initialization for readability

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

From f3fe3511da1ca37d92464c8cc3e2c163dae16017 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Fri, 3 Sep 2021 00:05:56 +0900
Subject: [ruby/reline] Swap the order of initialization for readability

https://github.com/ruby/reline/commit/d53749b208
---
 lib/reline/line_editor.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 1aa0360..4ed79ab 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -605,14 +605,14 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L605
       return
     end
     old_dialog = dialog.clone
+    dialog.contents = dialog_render_info.contents
+    pointer = dialog_render_info.pointer
     if dialog_render_info.width
       dialog.width = dialog_render_info.width
     else
-      dialog.width = dialog_render_info.contents.map { |l| calculate_width(l, true) }.max
+      dialog.width = dialog.contents.map { |l| calculate_width(l, true) }.max
     end
     height = dialog_render_info.height || DIALOG_HEIGHT
-    pointer = dialog_render_info.pointer
-    dialog.contents = dialog_render_info.contents
     height = dialog.contents.size if dialog.contents.size < height
     if dialog.contents.size > height
       if dialog_render_info.pointer
-- 
cgit v1.1


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

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