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

ruby-changes:67313

From: aycabta <ko1@a...>
Date: Sun, 29 Aug 2021 20:30:50 +0900 (JST)
Subject: [ruby-changes:67313] 85dd0ad5e0 (master): [ruby/reline] Move dialog pos to left when goes beyond right edge

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

From 85dd0ad5e00332f03835640ac01056d54d011468 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Mon, 23 Aug 2021 21:57:48 +0900
Subject: [ruby/reline] Move dialog pos to left when goes beyond right edge

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

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index d8e2842..0f27237 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -547,6 +547,10 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L547
     lower_space = @highest_in_all - @first_line_started_from - @started_from - 1
     @dialog_updown = nil
     @dialog_column = pos.x
+    diff = (@dialog_column + DIALOG_WIDTH) - (@screen_size.last - 1)
+    if diff > 0
+      @dialog_column -= diff
+    end
     if (lower_space + @rest_height) >= DIALOG_HEIGHT
       @dialog_updown = :down
       @dialog_vertical_offset = 1
-- 
cgit v1.1


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

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