From ec759011201ce16db7079dbc26ae9c085c2608ba Mon Sep 17 00:00:00 2001 From: aycabta Date: Sun, 26 May 2019 01:32:12 +0900 Subject: [PATCH] Fix completion menu state calculation --- lib/reline/line_editor.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index b069a0d912..af634da650 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -257,10 +257,15 @@ class Reline::LineEditor def rerender # TODO: support physical and logical lines if @menu_info - @output.puts + scroll_down(@highest_in_all - @first_line_started_from) + @rerender_all = true @menu_info.list.each do |item| - @output.puts item + Reline::IOGate.move_cursor_column(0) + @output.print item + scroll_down(1) end + scroll_down(@highest_in_all - 1) + move_cursor_up(@highest_in_all - 1 - @first_line_started_from) @menu_info = nil end return if @line.nil?