Skip to content

Commit

Permalink
Clear only necessary parts when dialog disappearing
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed Sep 2, 2021
1 parent a188176 commit 46ff0ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/reline/line_editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,9 @@ def add_dialog_proc(name, p, context = nil)
dialog_vertical_size = dialog.contents.size
dialog_vertical_size.times do |i|
if i < visual_lines_under_dialog.size
Reline::IOGate.move_cursor_column(0)
str = padding_space_with_escape_sequences(visual_lines_under_dialog[i], dialog.width)
Reline::IOGate.move_cursor_column(dialog.column)
str = Reline::Unicode.take_range(visual_lines_under_dialog[i], dialog.column, dialog.width)
str = padding_space_with_escape_sequences(str, dialog.width)
@output.write "\e[39m\e[49m#{str}\e[39m\e[49m"
else
Reline::IOGate.move_cursor_column(dialog.column)
Expand Down

0 comments on commit 46ff0ff

Please sign in to comment.