[前][次][番号順一覧][スレッド一覧]

ruby-changes:65170

From: aycabta <ko1@a...>
Date: Sun, 7 Feb 2021 05:16:58 +0900 (JST)
Subject: [ruby-changes:65170] b371ca3f4f (master): [ruby/reline] Handle past logs correctly when the code is higher than the screen

https://git.ruby-lang.org/ruby.git/commit/?id=b371ca3f4f

From b371ca3f4f304fdc219fe638ff3614b02780c2d3 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Sun, 31 Jan 2021 23:44:13 +0900
Subject: [ruby/reline] Handle past logs correctly when the code is higher than
 the screen

https://github.com/ruby/reline/commit/f197139b4a
---
 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 47ffe4d..16c41b5 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -600,7 +600,13 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L600
       new_first_line_started_from = calculate_height_by_lines(new_buffer[0..(@line_index - 1)], prompt_list || prompt)
     end
     new_started_from = calculate_height_by_width(prompt_width + @cursor) - 1
-    if back > old_highest_in_all
+    calculate_scroll_partial_screen(back, new_first_line_started_from + new_started_from)
+    if @scroll_partial_screen
+      move_cursor_up(@first_line_started_from + @started_from)
+      scroll_down(@screen_height - 1)
+      move_cursor_up(@screen_height)
+      Reline::IOGate.move_cursor_column(0)
+    elsif back > old_highest_in_all
       scroll_down(back - 1)
       move_cursor_up(back - 1)
     elsif back < old_highest_in_all
@@ -612,7 +618,6 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L618
       end
       move_cursor_up(old_highest_in_all - 1)
     end
-    calculate_scroll_partial_screen(back, new_first_line_started_from + new_started_from)
     render_whole_lines(new_buffer, prompt_list || prompt, prompt_width)
     if @prompt_proc
       prompt = prompt_list[@line_index]
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]