aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-30 15:19:30 +0900
committeraycabta <aycabta@gmail.com>2019-05-30 15:19:30 +0900
commit5a229b0a88679529a18aa3ef87317bdbd1783c58 (patch)
treed9130d3e82c96a50d25779227d5104417ce8de5d
parent90014dddec70219c2da800bf0d4d262bfa99c9a8 (diff)
downloadruby-5a229b0a88679529a18aa3ef87317bdbd1783c58.tar.gz
Calculate vertical position correctly when rerendering all lines
-rw-r--r--lib/reline/line_editor.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 088d220916..e84d087ac1 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -422,7 +422,8 @@ class Reline::LineEditor
result + calculate_height_by_width(@prompt_width + calculate_width(line))
}
end
- move_cursor_down(@first_line_started_from)
+ @started_from = calculate_height_by_width(@prompt_width + @cursor) - 1
+ move_cursor_down(@first_line_started_from + @started_from)
Reline::IOGate.move_cursor_column((prompt_width + @cursor) % @screen_size.last)
@rerender_all = false
rendered = true