File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2395,6 +2395,9 @@ def finish
2395
2395
width = Reline ::Unicode . get_mbchar_width ( mbchar )
2396
2396
@cursor_max -= width
2397
2397
if @cursor > 0 and @cursor >= @cursor_max
2398
+ byte_size = Reline ::Unicode . get_prev_mbchar_size ( @line , @byte_pointer )
2399
+ mbchar = @line . byteslice ( @byte_pointer - byte_size , byte_size )
2400
+ width = Reline ::Unicode . get_mbchar_width ( mbchar )
2398
2401
@byte_pointer -= byte_size
2399
2402
@cursor -= width
2400
2403
end
Original file line number Diff line number Diff line change @@ -1434,4 +1434,22 @@ def test_pasting_fullwidth
1434
1434
assert_cursor ( 4 )
1435
1435
assert_cursor_max ( 4 )
1436
1436
end
1437
+
1438
+ def test_ed_delete_next_char_at_eol
1439
+ input_keys ( '"あ"' )
1440
+ assert_line ( '"あ"' )
1441
+ assert_byte_pointer_size ( '"あ"' )
1442
+ assert_cursor ( 4 )
1443
+ assert_cursor_max ( 4 )
1444
+ input_keys ( "\C -[" )
1445
+ assert_line ( '"あ"' )
1446
+ assert_byte_pointer_size ( '"あ' )
1447
+ assert_cursor ( 3 )
1448
+ assert_cursor_max ( 4 )
1449
+ input_keys ( 'xa"' )
1450
+ assert_line ( '"あ"' )
1451
+ assert_byte_pointer_size ( '"あ"' )
1452
+ assert_cursor ( 4 )
1453
+ assert_cursor_max ( 4 )
1454
+ end
1437
1455
end
You can’t perform that action at this time.
0 commit comments