mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] PR changes
https://github.com/ruby/reline/commit/e8e8d81f47
This commit is contained in:
parent
9d19d910c0
commit
696e8914b7
2 changed files with 13 additions and 1 deletions
|
@ -1430,7 +1430,7 @@ class Reline::LineEditor
|
|||
if @waiting_operator_proc
|
||||
if VI_MOTIONS.include?(method_symbol)
|
||||
old_cursor, old_byte_pointer = @cursor, @byte_pointer
|
||||
@vi_arg = @waiting_operator_vi_arg if (@waiting_operator_vi_arg || 1) > 1
|
||||
@vi_arg = @waiting_operator_vi_arg if @waiting_operator_vi_arg&.> 1
|
||||
block.(true)
|
||||
unless @waiting_proc
|
||||
cursor_diff, byte_pointer_diff = @cursor - old_cursor, @byte_pointer - old_byte_pointer
|
||||
|
|
|
@ -1454,4 +1454,16 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase
|
|||
assert_cursor_max(1)
|
||||
assert_line('c')
|
||||
end
|
||||
|
||||
def test_vi_motion_operators
|
||||
assert_instance_of(Reline::KeyActor::ViInsert, @config.editing_mode)
|
||||
|
||||
begin
|
||||
input_keys("test = { foo: bar }\C-[BBBldt}b")
|
||||
|
||||
assert true
|
||||
rescue NoMethodError
|
||||
assert false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue