diff options
author | aycabta <aycabta@gmail.com> | 2019-05-21 01:14:53 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-21 01:49:27 +0900 |
commit | b69dfdb4b3d9dfce18123d1814087fc49b390ea9 (patch) | |
tree | f4ab6b56b1510367cae62491ef57db35e15432c6 /lib | |
parent | 8023b3ce9d654c1a58e1f4952b666e2c412938ca (diff) | |
download | ruby-b69dfdb4b3d9dfce18123d1814087fc49b390ea9.tar.gz |
Cursor up should reduce 1 than editing height
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index f9e2525ef3..a1541956ea 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -322,16 +322,16 @@ class Reline::LineEditor back += height end if back > @highest_in_all - scroll_down(back) - move_cursor_up(back) + scroll_down(back - 1) + move_cursor_up(back - 1) elsif back < @highest_in_all scroll_down(back) Reline::IOGate.erase_after_cursor - (@highest_in_all - back).times do + (@highest_in_all - back - 1).times do scroll_down(1) Reline::IOGate.erase_after_cursor end - move_cursor_up(@highest_in_all) + move_cursor_up(@highest_in_all - 1) end @buffer_of_lines.each_with_index do |line, index| render_partial(prompt, prompt_width, line, false) |