aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline/line_editor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r--lib/reline/line_editor.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index e84d087ac1..805053fbff 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -360,8 +360,12 @@ class Reline::LineEditor
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