1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Calculate vertical position correctly when rerendering all lines

This commit is contained in:
aycabta 2019-05-30 15:19:30 +09:00
parent 90014dddec
commit 5a229b0a88

View file

@ -422,7 +422,8 @@ class Reline::LineEditor
result + calculate_height_by_width(@prompt_width + calculate_width(line))
}
end
move_cursor_down(@first_line_started_from)
@started_from = calculate_height_by_width(@prompt_width + @cursor) - 1
move_cursor_down(@first_line_started_from + @started_from)
Reline::IOGate.move_cursor_column((prompt_width + @cursor) % @screen_size.last)
@rerender_all = false
rendered = true