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

ruby-changes:67317

From: aycabta <ko1@a...>
Date: Sun, 29 Aug 2021 20:30:55 +0900 (JST)
Subject: [ruby-changes:67317] 081e5de34d (master): [ruby/reline] Combine vertical processing into @dialog_vertical_offset

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

From 081e5de34d6801bc8793f28d1823551a4279dcbf Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Tue, 24 Aug 2021 21:33:13 +0900
Subject: [ruby/reline] Combine vertical processing into
 @dialog_vertical_offset

https://github.com/ruby/reline/commit/600b93620c
---
 lib/reline/line_editor.rb | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 5976e09..5a39ef2 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -572,11 +572,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L572
     end
     Reline::IOGate.hide_cursor
     reset_dialog(old_dialog_contents, old_dialog_contents_width, old_dialog_column, old_dialog_vertical_offset, old_dialog_updown)
-    case @dialog_updown
-    when :down
-      move_cursor_down(1)
-    when :up
-    end
+    move_cursor_down(@dialog_vertical_offset)
     Reline::IOGate.move_cursor_column(@dialog_column)
     @dialog_contents.each_with_index do |item, i|
       @output.write "\e[46m%-#{DIALOG_WIDTH}s\e[49m" % item.slice(0, DIALOG_WIDTH)
@@ -584,11 +580,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L580
       move_cursor_down(1) if i < (@dialog_contents.size - 1)
     end
     Reline::IOGate.move_cursor_column(cursor_column)
-    case @dialog_updown
-    when :down
-      move_cursor_up(@dialog_contents.size)
-    when :up
-    end
+    move_cursor_up(@dialog_vertical_offset + @dialog_contents.size - 1)
     Reline::IOGate.show_cursor
     @dialog_lines_backup = {
       lines: modify_lines(whole_lines),
-- 
cgit v1.1


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

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