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

ruby-changes:67370

From: aycabta <ko1@a...>
Date: Tue, 31 Aug 2021 05:26:38 +0900 (JST)
Subject: [ruby-changes:67370] 0c09418fff (master): [ruby/reline] Fix dialog rendering at the bottom edge

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

From 0c09418fff2900d8e878f3ad92469a060d159667 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Tue, 31 Aug 2021 01:13:21 +0900
Subject: [ruby/reline] Fix dialog rendering at the bottom edge

https://github.com/ruby/reline/commit/860be91bd7
---
 lib/reline/line_editor.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index c6d0c9f..f93731d 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -592,14 +592,14 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L592
     if diff > 0
       dialog.column -= diff
     end
-    if (lower_space + @rest_height) >= DIALOG_HEIGHT
+    if (lower_space + @rest_height - pos.y) >= DIALOG_HEIGHT
       dialog.vertical_offset = pos.y + 1
     elsif upper_space >= DIALOG_HEIGHT
       dialog.vertical_offset = pos.y + -(DIALOG_HEIGHT + 1)
     else
-      if (lower_space + @rest_height) < DIALOG_HEIGHT
-        scroll_down(DIALOG_HEIGHT)
-        move_cursor_up(DIALOG_HEIGHT)
+      if (lower_space + @rest_height - pos.y) < DIALOG_HEIGHT
+        scroll_down(DIALOG_HEIGHT + pos.y)
+        move_cursor_up(DIALOG_HEIGHT + pos.y)
       end
       dialog.vertical_offset = pos.y + 1
     end
-- 
cgit v1.1


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

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