mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix strange vertical cursor moving when adding a newline at bottom
This commit is contained in:
parent
106843d839
commit
fcca39fa73
1 changed files with 6 additions and 2 deletions
|
@ -360,8 +360,12 @@ class Reline::LineEditor
|
||||||
back = 0
|
back = 0
|
||||||
modify_lines(new_lines).each_with_index do |line, index|
|
modify_lines(new_lines).each_with_index do |line, index|
|
||||||
height = render_partial(prompt, prompt_width, line, false)
|
height = render_partial(prompt, prompt_width, line, false)
|
||||||
move_cursor_down(1)
|
if index < (new_lines.size - 1)
|
||||||
back += height
|
scroll_down(1)
|
||||||
|
back += height
|
||||||
|
else
|
||||||
|
back += height - 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
move_cursor_up(back)
|
move_cursor_up(back)
|
||||||
if @previous_line_index
|
if @previous_line_index
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue