1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Move dialog pos to left when goes beyond right edge

f1efa2b062
This commit is contained in:
aycabta 2021-08-23 21:57:48 +09:00
parent d768eeeddb
commit 85dd0ad5e0

View file

@ -547,6 +547,10 @@ class Reline::LineEditor
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