diff options
author | aycabta <aycabta@gmail.com> | 2020-11-07 12:05:43 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-12-05 02:58:58 +0900 |
commit | ba8e5f77eb2562cc0605f1414426a34c7e844964 (patch) | |
tree | f3772aceee4021369d8215a529b23e4a4a728253 /test | |
parent | 6be3b2da19a45e21c63ed0a9c51fa4e1a0d1bd08 (diff) |
[ruby/reline] Motions e, E, t, f should include a char on cursor if follows operator
https://github.com/ruby/reline/commit/86e9a76499
Diffstat (limited to 'test')
-rw-r--r-- | test/reline/test_key_actor_vi.rb | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb index 6f318db46c..7c0eea1fa1 100644 --- a/test/reline/test_key_actor_vi.rb +++ b/test/reline/test_key_actor_vi.rb @@ -1224,8 +1224,8 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase input_keys('df_') assert_byte_pointer_size('aaa bbb ') assert_cursor(8) - assert_cursor_max(15) - assert_line('aaa bbb ___ ddd') + assert_cursor_max(14) + assert_line('aaa bbb __ ddd') end def test_vi_delete_meta_with_arg @@ -1294,4 +1294,63 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase assert_cursor(2) assert_cursor_max(10) end + + def test_vi_end_word_with_operator + input_keys("foo bar\C-[0") + assert_line('foo bar') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(7) + input_keys('de') + assert_line(' bar') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(4) + input_keys('de') + assert_line('') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(0) + input_keys('de') + assert_line('') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(0) + end + + def test_vi_end_big_word_with_operator + input_keys("aaa b{b}}}b\C-[0") + assert_line('aaa b{b}}}b') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(13) + input_keys('dE') + assert_line(' b{b}}}b') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(10) + input_keys('dE') + assert_line('') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(0) + input_keys('dE') + assert_line('') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(0) + end + + def test_vi_next_char_with_operator + input_keys("foo bar\C-[0") + assert_line('foo bar') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(7) + input_keys('df ') + assert_line('bar') + assert_byte_pointer_size('') + assert_cursor(0) + assert_cursor_max(3) + end end |