Skip to content

Commit

Permalink
Calculate vertical position correctly when rerendering all lines
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed May 30, 2019
1 parent 90014dd commit 5a229b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/reline/line_editor.rb
Expand Up @@ -422,7 +422,8 @@ def rerender # TODO: support physical and logical lines
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
Expand Down

0 comments on commit 5a229b0

Please sign in to comment.