diff options
author | aycabta <aycabta@gmail.com> | 2020-01-17 01:35:13 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-01-17 01:37:01 +0900 |
commit | 800c2a8e4c4b644aca4bede913d492c25ba304c1 (patch) | |
tree | b48c000f5e4b0f8ff5124131fa068b72b73fe3c5 /lib | |
parent | ec0b366a5c6eadab1315a8f2681a0ef6de20be75 (diff) | |
download | ruby-800c2a8e4c4b644aca4bede913d492c25ba304c1.tar.gz |
Implement vi_insert_at_bol and vi_add_at_eol
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index dda602e155..1387bfa876 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -1890,6 +1890,16 @@ class Reline::LineEditor end end + private def vi_insert_at_bol(key) + ed_move_to_beg(key) + @config.editing_mode = :vi_insert + end + + private def vi_add_at_eol(key) + ed_move_to_end(key) + @config.editing_mode = :vi_insert + end + private def ed_delete_prev_char(key, arg: 1) deleted = '' arg.times do |