Skip to content

Commit

Permalink
Join next line if deletes newline at end of line
Browse files Browse the repository at this point in the history
  • Loading branch information
aycabta committed May 27, 2019
1 parent 69c7ad1 commit 7447c7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/reline/line_editor.rb
Expand Up @@ -1256,6 +1256,14 @@ def finish
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

Expand Down

0 comments on commit 7447c7b

Please sign in to comment.