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:
parent
d768eeeddb
commit
85dd0ad5e0
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue