1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Enter key always means evaluate in Reline#readmultiline

This commit is contained in:
aycabta 2019-05-25 02:13:14 +09:00
parent 637ee7ee38
commit ff43b22627

View file

@ -1096,16 +1096,21 @@ class Reline::LineEditor
if @line_index < (@buffer_of_lines.size - 1) if @line_index < (@buffer_of_lines.size - 1)
ed_next_history(key) # means cursor down ed_next_history(key) # means cursor down
else else
finish if confirm_multiline_termination # should check confirm_multiline_termination to finish?
finish
end end
else else
if @line_index == (@buffer_of_lines.size - 1) and confirm_multiline_termination if @line_index == (@buffer_of_lines.size - 1)
finish if confirm_multiline_termination
finish
else
key_newline(key)
end
else else
next_line = @line.byteslice(@byte_pointer, @line.bytesize - @byte_pointer) # should check confirm_multiline_termination to finish?
cursor_line = @line.byteslice(0, @byte_pointer) @previous_line_index = @line_index
insert_new_line(cursor_line, next_line) @line_index = @buffer_of_lines.size - 1
@cursor = 0 finish
end end
end end
else else