diff options
author | aycabta <aycabta@gmail.com> | 2019-05-21 08:10:36 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-21 08:10:36 +0900 |
commit | df6a673ca55d26a768ead23466c7e055a8596d7a (patch) | |
tree | 43af4ca17a09cc14a90176905ced7f9316e0adbe /lib | |
parent | 34d7ec4e9b0a24b3ce89009927738f1dac38e6d3 (diff) | |
download | ruby-df6a673ca55d26a768ead23466c7e055a8596d7a.tar.gz |
Fix vertical cursor moving when splitting line
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index a611a4d4f0..9df263aba1 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -281,9 +281,10 @@ class Reline::LineEditor } diff = all_height - @highest_in_all if diff > 0 + move_cursor_down(@highest_in_all - @first_line_started_from - @started_from - 1) @highest_in_all = all_height scroll_down(diff) - move_cursor_up(@first_line_started_from + @started_from + diff) + move_cursor_up(@highest_in_all - 1) back = 0 @buffer_of_lines.each_with_index do |line, index| line = @line if index == @previous_line_index |