mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Reset @rest_height when clear screen
https://github.com/ruby/reline/commit/3a7019b0d5
This commit is contained in:
parent
9e336f73fb
commit
7e93917458
2 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue