Skip to content

Commit

Permalink
Implement vi_kill_line_prev
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jez committed Sep 9, 2021
1 parent dc50b59 commit fdbfc86
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/reline/line_editor.rb
Expand Up @@ -2539,6 +2539,7 @@ def finish
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)
Expand Down

0 comments on commit fdbfc86

Please sign in to comment.