[前][次][番号順一覧][スレッド一覧]

ruby-changes:58931

From: aycabta <ko1@a...>
Date: Thu, 28 Nov 2019 09:34:49 +0900 (JST)
Subject: [ruby-changes:58931] abe8fb49f0 (master): Delete newline when C-k on emacs mode at EOL

https://git.ruby-lang.org/ruby.git/commit/?id=abe8fb49f0

From abe8fb49f0365c23df06857549b7a3a32d212ed5 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Thu, 28 Nov 2019 09:32:51 +0900
Subject: Delete newline when C-k on emacs mode at EOL


diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index ed1e730..71d7651 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -1417,6 +1417,14 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L1417
       @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
 
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]