diff options
author | aycabta <aycabta@gmail.com> | 2021-09-10 07:36:28 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-09-10 09:05:25 +0900 |
commit | 5af602e4d48fd9951bcdd873b3e471ca4b123d45 (patch) | |
tree | a9beceeb3e9cc81b7eccebcede3e15ab5e229034 /lib/reline/line_editor.rb | |
parent | f51ce20c6ad59eb8e274bde1780dae58020cb192 (diff) | |
download | ruby-5af602e4d48fd9951bcdd873b3e471ca4b123d45.tar.gz |
[ruby/reline] Erase lines correctly when dialog height is changed
https://github.com/ruby/reline/commit/68d2516551
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r-- | lib/reline/line_editor.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 0a24a9da08..b2f7728a42 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -764,10 +764,10 @@ class Reline::LineEditor line_num.times do |i| Reline::IOGate.move_cursor_column(old_dialog.column) if visual_lines[start + i].nil? - s = ' ' * dialog.width + s = ' ' * old_dialog.width else - s = Reline::Unicode.take_range(visual_lines[start + i], old_dialog.column, dialog.width) - s = padding_space_with_escape_sequences(s, dialog.width) + s = Reline::Unicode.take_range(visual_lines[start + i], old_dialog.column, old_dialog.width) + s = padding_space_with_escape_sequences(s, old_dialog.width) end @output.write "\e[39m\e[49m#{s}\e[39m\e[49m" move_cursor_down(1) if i < (line_num - 1) @@ -782,10 +782,10 @@ class Reline::LineEditor line_num.times do |i| Reline::IOGate.move_cursor_column(old_dialog.column) if visual_lines[start + i].nil? - s = ' ' * dialog.width + s = ' ' * old_dialog.width else - s = Reline::Unicode.take_range(visual_lines[start + i], old_dialog.column, dialog.width) - s = padding_space_with_escape_sequences(s, dialog.width) + s = Reline::Unicode.take_range(visual_lines[start + i], old_dialog.column, old_dialog.width) + s = padding_space_with_escape_sequences(s, old_dialog.width) end @output.write "\e[39m\e[49m#{s}\e[39m\e[49m" move_cursor_down(1) if i < (line_num - 1) |