summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJake Zimmerman <zimmerman.jake@gmail.com>2021-09-09 15:35:07 -0700
committergit <svn-admin@ruby-lang.org>2021-09-26 23:47:11 +0900
commit3f7b08d2cbdaa2d8c917e53cfa57210d0d99b0bf (patch)
tree5b28144ba7c4c8682fb72b5cb5245dd951b81532
parent389de6f052ff8b835594d3109b2f214d995838c2 (diff)
[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
-rw-r--r--lib/reline/line_editor.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index c7d6ff44477..10ff766dcc9 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -2540,6 +2540,7 @@ class Reline::LineEditor
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)