diff --git a/docs/changelog.rst b/docs/changelog.rst index cb991988e..9948d84ce 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -130,6 +130,8 @@ Detailed list of changes - Fix a regression in 0.40.0 that broke serialization of tab characters as ANSI text (:iss:`8741`) +- Fix a regression in 0.40.0 that broke erasing of characters in a line in the presence of wide characters (:iss:`8758`) + - kitten run-shell: Fix SIGINT blocked when execing the shell (:iss:`8754`) 0.42.1 [2025-05-17] diff --git a/kitty/screen.c b/kitty/screen.c index a40c5981b..dcff61c10 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -440,7 +440,7 @@ nuke_incomplete_single_line_multicell_chars_in_range( if (cpu_cells[x].is_multicell) { index_type mcd_x_limit = x + cpu_cells[x].width - cpu_cells[x].x; if (cpu_cells[x].x || mcd_x_limit > limit) nuke_in_line(cpu_cells, gpu_cells, x, MIN(mcd_x_limit, limit), replace_with_spaces ? ' ': 0); - x = mcd_x_limit; + x = mcd_x_limit - 1; } } } diff --git a/kitty_tests/multicell.py b/kitty_tests/multicell.py index 9908faed5..f91798f1d 100644 --- a/kitty_tests/multicell.py +++ b/kitty_tests/multicell.py @@ -308,6 +308,12 @@ def test_multicell(self: TestMulticell) -> None: # Test delete chars with multicell (aka left shift) s.reset() + s.draw(' 允许') + s.cursor.x = 0 + s.delete_characters(1) + for x in range(4): + ac(x, 0, width=2) + s.reset() multicell(s, 'a', width=2) s.cursor.x = 0 s.delete_characters(1)