diff options
-rw-r--r-- | lib/reline/line_editor.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index d8e2842e6a..0f27237a1a 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -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 |