[ruby/reline] Reset @rest_height when clear screen

https://github.com/ruby/reline/commit/3a7019b0d5
This commit is contained in:
aycabta 2021-04-02 17:18:37 +09:00
Родитель 9e336f73fb
Коммит 7e93917458
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -813,6 +813,7 @@ class Reline::LineEditor
end
move_cursor_up(back)
move_cursor_down(@first_line_started_from + @started_from)
@rest_height = (Reline::IOGate.get_screen_size.first - 1) - Reline::IOGate.cursor_pos.y
Reline::IOGate.move_cursor_column((prompt_width + @cursor) % @screen_size.last)
end

Просмотреть файл

@ -719,6 +719,17 @@ begin
EOC
end
def test_reset_rest_height_when_clear_screen
start_terminal(5, 20, %W{ruby -I#{@pwd}/lib #{@pwd}/test/reline/yamatanooroti/multiline_repl}, startup_message: 'Multiline REPL.')
write("\n\n\n\C-l3\n")
close
assert_screen(<<~EOC)
prompt> 3
=> 3
prompt>
EOC
end
private def write_inputrc(content)
File.open(@inputrc_file, 'w') do |f|
f.write content