ruby-changes:68131
From: Jake <ko1@a...>
Date: Sun, 26 Sep 2021 23:47:28 +0900 (JST)
Subject: [ruby-changes:68131] 3f7b08d2cb (master): [ruby/reline] Implement vi_kill_line_prev
https://git.ruby-lang.org/ruby.git/commit/?id=3f7b08d2cb From 3f7b08d2cbdaa2d8c917e53cfa57210d0d99b0bf Mon Sep 17 00:00:00 2001 From: Jake Zimmerman <zimmerman.jake@g...> Date: Thu, 9 Sep 2021 15:35:07 -0700 Subject: [ruby/reline] Implement vi_kill_line_prev This operation is mentioned and bound to `^U` in both `vi_command.rb` and `vi_insert.rb`, but there is no definition of it. Both Vi and Emacs use the same keystroke to do the same behavior, so I've chosen to use `alias_method` to make the implementation small, rather than duplicating the method and re-implementing it. https://github.com/ruby/reline/commit/fdbfc8669f --- lib/reline/line_editor.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index c7d6ff4..10ff766 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -2540,6 +2540,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L2540 end end alias_method :kill_line, :em_kill_line + alias_method :vi_kill_line_prev, :em_kill_line private def em_delete(key) if (not @is_multiline and @line.empty?) or (@is_multiline and @line.empty? and @buffer_of_lines.size == 1) -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/