summaryrefslogtreecommitdiff
path: root/test/reline
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2024-04-15 22:15:52 +0900
committergit <svn-admin@ruby-lang.org>2024-04-15 13:15:58 +0000
commit43f4da3ebfe39995fa6476af4ba4514ece8e4b4a (patch)
treeda8b939ff3e21da933d739b0b94a7002339b211c /test/reline
parent07ff4aa19b4f7cda9948ef5104bd1623e0c3eafc (diff)
[ruby/reline] Fix vi_to_column which was broken
(https://github.com/ruby/reline/pull/679) https://github.com/ruby/reline/commit/9e93ad52e7
Diffstat (limited to 'test/reline')
-rw-r--r--test/reline/test_key_actor_vi.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/reline/test_key_actor_vi.rb b/test/reline/test_key_actor_vi.rb
index e72eedb904..cf3943ae37 100644
--- a/test/reline/test_key_actor_vi.rb
+++ b/test/reline/test_key_actor_vi.rb
@@ -711,6 +711,20 @@ class Reline::KeyActor::ViInsert::Test < Reline::TestCase
assert_line_around_cursor('', ' abcde ABCDE ')
end
+ def test_vi_to_column
+ input_keys("a一二三\C-[0")
+ input_keys('1|')
+ assert_line_around_cursor('', 'a一二三')
+ input_keys('2|')
+ assert_line_around_cursor('a', '一二三')
+ input_keys('3|')
+ assert_line_around_cursor('a', '一二三')
+ input_keys('4|')
+ assert_line_around_cursor('a一', '二三')
+ input_keys('9|')
+ assert_line_around_cursor('a一二', '三')
+ end
+
def test_vi_delete_meta
input_keys("aaa bbb ccc ddd eee\C-[02w")
assert_line_around_cursor('aaa bbb ', 'ccc ddd eee')