summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-27 08:39:39 +0900
committeraycabta <aycabta@gmail.com>2019-05-27 08:39:39 +0900
commit9c136f3dea0c6052fefb377bf2c445daec1ca0b6 (patch)
treedb4a662dc5dd342a81bdd008200d5e19a29404f2 /lib
parent4e2c7783e364f37a748fe0d3a3cd9f96e58287c0 (diff)
Move to next of last line by ^D
Diffstat (limited to 'lib')
-rw-r--r--lib/reline/line_editor.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 32b49dbb7d..e257ab335e 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -269,6 +269,7 @@ class Reline::LineEditor
end
def rerender # TODO: support physical and logical lines
+ return if @line.nil?
if @menu_info
scroll_down(@highest_in_all - @first_line_started_from)
@rerender_all = true
@@ -281,7 +282,6 @@ class Reline::LineEditor
move_cursor_up(@highest_in_all - 1 - @first_line_started_from)
@menu_info = nil
end
- return if @line.nil?
if @vi_arg
prompt = "(arg: #{@vi_arg}) "
prompt_width = calculate_width(prompt)
@@ -1194,6 +1194,8 @@ class Reline::LineEditor
private def em_delete_or_list(key)
if @line.empty?
@line = nil
+ scroll_down(@highest_in_all - @first_line_started_from)
+ Reline::IOGate.move_cursor_column(0)
finish
elsif @byte_pointer < @line.bytesize
splitted_last = @line.byteslice(@byte_pointer, @line.bytesize)
@@ -1486,6 +1488,8 @@ class Reline::LineEditor
private def vi_end_of_transmission(key)
if @line.empty?
@line = nil
+ scroll_down(@highest_in_all - @first_line_started_from)
+ Reline::IOGate.move_cursor_column(0)
finish
end
end
@@ -1493,6 +1497,8 @@ class Reline::LineEditor
private def vi_list_or_eof(key)
if @line.empty?
@line = nil
+ scroll_down(@highest_in_all - @first_line_started_from)
+ Reline::IOGate.move_cursor_column(0)
finish
else
# TODO: list