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

ruby-changes:67309

From: aycabta <ko1@a...>
Date: Sun, 29 Aug 2021 20:30:45 +0900 (JST)
Subject: [ruby-changes:67309] 475038a622 (master): [ruby/reline] Move cursor correctly when current line is auto wrapped

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

From 475038a622689a7c1ac2e7a4d057e81cdbd079bb Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Wed, 25 Aug 2021 17:22:54 +0900
Subject: [ruby/reline] Move cursor correctly when current line is auto wrapped

https://github.com/ruby/reline/commit/14c8fade54
---
 lib/reline/line_editor.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 40667d3..5d7095b 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -678,7 +678,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L678
       end
       move_cursor_up(old_dialog_vertical_offset + line_num - 1 + y_diff)
     end
-    Reline::IOGate.move_cursor_column(prompt_width + @cursor)
+    Reline::IOGate.move_cursor_column((prompt_width + @cursor) % @screen_size.last)
   end
 
   private def clear_dialog
@@ -712,7 +712,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L712
       move_cursor_down(1) if i < (dialog_vertical_size - 1)
     end
     move_cursor_up(dialog_vertical_size - 1 + @dialog_vertical_offset)
-    Reline::IOGate.move_cursor_column(prompt_width + @cursor)
+    Reline::IOGate.move_cursor_column((prompt_width + @cursor) % @screen_size.last)
     Reline::IOGate.show_cursor
   end
 
-- 
cgit v1.1


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

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