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

ruby-changes:68333

From: aycabta <ko1@a...>
Date: Sat, 9 Oct 2021 23:23:10 +0900 (JST)
Subject: [ruby-changes:68333] e6ba2953e9 (master): [ruby/reline] Fix calculating dialog width with full-width scrollbar

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

From e6ba2953e98f7feff90d767106b0a35560582ca0 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Sat, 9 Oct 2021 22:19:05 +0900
Subject: [ruby/reline] Fix calculating dialog width with full-width scrollbar

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

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 7c68037878..a71bb65259 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -703,7 +703,8 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L703
     upper_space = @first_line_started_from - @started_from
     lower_space = @highest_in_all - @first_line_started_from - @started_from - 1
     dialog.column = dialog_render_info.pos.x
-    diff = (dialog.column + dialog.width) - (@screen_size.last - 1)
+    dialog.width += @block_elem_width if dialog.scrollbar_pos
+    diff = (dialog.column + dialog.width) - (@screen_size.last)
     if diff > 0
       dialog.column -= diff
     end
@@ -719,7 +720,6 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L720
       dialog.vertical_offset = dialog_render_info.pos.y + 1
     end
     Reline::IOGate.hide_cursor
-    dialog.width += @block_elem_width if dialog.scrollbar_pos
     if dialog.column < 0
       dialog.column = 0
       dialog.width = @screen_size.last
-- 
cgit v1.2.1


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

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