File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2563,6 +2563,13 @@ def finish
2563
2563
end
2564
2564
alias_method :kill_line , :ed_kill_line
2565
2565
2566
+ # Editline:: +vi_change_to_eol+ (vi command: +C+) + Kill and change from the cursor to the end of the line.
2567
+ private def vi_change_to_eol ( key )
2568
+ ed_kill_line ( key )
2569
+
2570
+ @config . editing_mode = :vi_insert
2571
+ end
2572
+
2566
2573
# Editline:: +vi-kill-line-prev+ (vi: +Ctrl-U+) Delete the string from the
2567
2574
# beginning of the edit buffer to the cursor and save it to the
2568
2575
# cut buffer.
Original file line number Diff line number Diff line change @@ -1455,6 +1455,16 @@ def test_vi_kill_line_prev
1455
1455
assert_line ( 'c' )
1456
1456
end
1457
1457
1458
+ def test_vi_change_to_eol
1459
+ input_keys ( "abcdef\C -[2hC" )
1460
+ assert_line ( "abc" )
1461
+ input_keys ( "\C -[0C" )
1462
+ assert_line ( "" )
1463
+ assert_cursor ( 0 )
1464
+ assert_cursor_max ( 0 )
1465
+ assert_instance_of ( Reline ::KeyActor ::ViInsert , @config . editing_mode )
1466
+ end
1467
+
1458
1468
def test_vi_motion_operators
1459
1469
assert_instance_of ( Reline ::KeyActor ::ViInsert , @config . editing_mode )
1460
1470
You can’t perform that action at this time.
0 commit comments