1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] Unimplemented vi command should be no-op

https://github.com/ruby/reline/commit/abc90e6867
This commit is contained in:
aycabta 2020-11-02 15:22:11 +09:00
parent faf8f216be
commit 92b22db6a7
2 changed files with 15 additions and 2 deletions

View file

@ -771,7 +771,7 @@ class Reline::LineEditor
elsif method_obj
wrap_method_call(method_symbol, method_obj, key)
else
ed_insert(key)
ed_insert(key) unless @config.editing_mode_is?(:vi_command)
end
@kill_ring.process
@vi_arg = nil
@ -789,7 +789,7 @@ class Reline::LineEditor
end
@kill_ring.process
else
ed_insert(key)
ed_insert(key) unless @config.editing_mode_is?(:vi_command)
end
end

View file

@ -1250,4 +1250,17 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase
assert_cursor_max(16)
assert_line('aaa bbb ddd eee')
end
def test_unimplemented_vi_command_should_be_no_op
input_keys("abc\C-[h")
assert_byte_pointer_size('a')
assert_cursor(1)
assert_cursor_max(3)
assert_line('abc')
input_keys('@')
assert_byte_pointer_size('a')
assert_cursor(1)
assert_cursor_max(3)
assert_line('abc')
end
end