diff options
author | aycabta <[email protected]> | 2020-12-18 23:36:33 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2020-12-19 02:12:11 +0900 |
commit | d4257c6152ac9ad5179eb77d6e68942a5b9c011f (patch) | |
tree | 27b0fe0504f5c696a5c5c0f1d0def2f149e9880d /lib | |
parent | af2c81e10c15c267611e59f11b7152545c617826 (diff) |
[ruby/reline] Yank by em-kill-region correctly
This closes ruby/reline#106.
https://github.com/ruby/reline/commit/2549a52e15
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index dc1f8824a2..f33b22852d 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1941,6 +1941,7 @@ class Reline::LineEditor @cursor = 0 end end + alias_method :kill_line, :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) @@ -2139,9 +2140,10 @@ class Reline::LineEditor @byte_pointer -= byte_size @cursor -= width @cursor_max -= width - @kill_ring.append(deleted) + @kill_ring.append(deleted, true) end end + alias_method :unix_word_rubout, :em_kill_region private def copy_for_vi(text) if @config.editing_mode_is?(:vi_insert) or @config.editing_mode_is?(:vi_command) |