Skip to content

Commit

Permalink
Drop too much contents before processing
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Aug 24, 2021
1 parent 49f3392 commit 94f7027
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reline/line_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ def dialog_proc=(p)
old_dialog_updown = @dialog_updown
if result and not result.empty?
@dialog_contents = result
@dialog_contents = @dialog_contents[0...DIALOG_HEIGHT] if @dialog_contents.size > DIALOG_HEIGHT
@dialog_contents_width = @dialog_contents.map{ |c| calculate_width(c) }
else
clear_dialog
Expand Down Expand Up @@ -577,7 +578,6 @@ def dialog_proc=(p)
when :up
end
Reline::IOGate.move_cursor_column(@dialog_column)
@dialog_contents = @dialog_contents[0...DIALOG_HEIGHT] if @dialog_contents.size > DIALOG_HEIGHT
@dialog_contents.each_with_index do |item, i|
@output.write "\e[46m%-#{DIALOG_WIDTH}s\e[49m" % item.slice(0, DIALOG_WIDTH)
Reline::IOGate.move_cursor_column(@dialog_column)
Expand Down

0 comments on commit 94f7027

Please sign in to comment.