diff options
author | aycabta <aycabta@gmail.com> | 2019-05-28 01:52:04 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-28 01:52:04 +0900 |
commit | 7447c7b651d9074879429bb84dd73f8821521f27 (patch) | |
tree | 1fae9ea5174e8d19e73c928720105d1564082a89 /lib | |
parent | 69c7ad17235319c78766102068402ab9fcc9a5ca (diff) | |
download | ruby-7447c7b651d9074879429bb84dd73f8821521f27.tar.gz |
Join next line if deletes newline at end of line
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index d1f3c9b6ac..44cb0577a2 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -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 |