Skip to content

Commit

Permalink
Fix strange vertical cursor moving when adding a newline at bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed May 30, 2019
1 parent 106843d commit fcca39f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/reline/line_editor.rb
Expand Up @@ -360,8 +360,12 @@ def rerender # TODO: support physical and logical lines
back = 0
modify_lines(new_lines).each_with_index do |line, index|
height = render_partial(prompt, prompt_width, line, false)
move_cursor_down(1)
back += height
if index < (new_lines.size - 1)
scroll_down(1)
back += height
else
back += height - 1
end
end
move_cursor_up(back)
if @previous_line_index
Expand Down

0 comments on commit fcca39f

Please sign in to comment.