[前][次][番号順一覧][スレッド一覧]

ruby-changes:73682

From: Ot=C3=A1vio <ko1@a...>
Date: Thu, 22 Sep 2022 22:28:49 +0900 (JST)
Subject: [ruby-changes:73682] 696e8914b7 (master): [ruby/reline] PR changes

https://git.ruby-lang.org/ruby.git/commit/?id=696e8914b7

From 696e8914b74cd10047917ce677b1872ae1f04660 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ot=C3=A1vio=20Schwanck=20dos=20Santos?=
 <otavioschwanck@g...>
Date: Tue, 20 Sep 2022 14:40:48 +0100
Subject: [ruby/reline] PR changes

https://github.com/ruby/reline/commit/e8e8d81f47
---
 lib/reline/line_editor.rb        |  2 +-
 test/reline/test_key_actor_vi.rb | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index 9703a8c9f3..8153aaba05 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -1430,7 +1430,7 @@ class Reline::LineEditor https://github.com/ruby/ruby/blob/trunk/lib/reline/line_editor.rb#L1430
     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
diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb
index b3d49c9bbb..5a8c4ac64d 100644
--- a/test/reline/test_key_actor_vi.rb
+++ b/test/reline/test_key_actor_vi.rb
@@ -1454,4 +1454,16 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase https://github.com/ruby/ruby/blob/trunk/test/reline/test_key_actor_vi.rb#L1454
     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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]