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

Join next line if deletes newline at end of line

This commit is contained in:
aycabta 2019-05-28 01:52:04 +09:00
parent 69c7ad1723
commit 7447c7b651

View file

@ -1256,6 +1256,14 @@ class Reline::LineEditor
width = Reline::Unicode.get_mbchar_width(mbchar)
@cursor_max -= width
@line, = byteslice!(@line, @byte_pointer, mbchar.bytesize)
elsif @is_multiline and @byte_pointer == @line.bytesize and @buffer_of_lines.size > @line_index + 1
@cursor = calculate_width(@line)
@byte_pointer = @line.bytesize
@line += @buffer_of_lines.delete_at(@line_index + 1)
@cursor_max = calculate_width(@line)
@buffer_of_lines[@line_index] = @line
@rerender_all = true
@rest_height += 1
end
end