summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-28 09:32:51 +0900
committeraycabta <aycabta@gmail.com>2019-11-28 09:32:51 +0900
commitabe8fb49f0365c23df06857549b7a3a32d212ed5 (patch)
tree2d7c5c2f0d4e6917995a3cda0494be6cb3028149
parent7769975c3ccf1f08c15f4c6de8451783683e281d (diff)
Delete newline when C-k on emacs mode at EOL
-rw-r--r--lib/reline/line_editor.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index ed1e730c9c..71d765109d 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -1417,6 +1417,14 @@ class Reline::LineEditor
@byte_pointer = @line.bytesize
@cursor = @cursor_max = calculate_width(@line)
@kill_ring.append(deleted)
+ 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