diff options
Diffstat (limited to 'lib/reline/line_editor.rb')
-rw-r--r-- | lib/reline/line_editor.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 86d57d905b..8425a475d6 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -2083,6 +2083,14 @@ class Reline::LineEditor end private def vi_yank(key) + @waiting_operator_proc = proc { |cursor_diff, byte_pointer_diff| + if byte_pointer_diff > 0 + cut = @line.byteslice(@byte_pointer, byte_pointer_diff) + elsif byte_pointer_diff < 0 + cut = @line.byteslice(@byte_pointer + byte_pointer_diff, -byte_pointer_diff) + end + copy_for_vi(cut) + } end private def vi_list_or_eof(key) |