diff --git a/kitty/screen.c b/kitty/screen.c index 747610f7d..628fbd953 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1030,13 +1030,11 @@ draw_text_loop(Screen *self, const uint32_t *chars, size_t num_chars, text_loop_ draw_control_char(self, s, ch); continue; } - if (ts_cursor_on_multicell(self, s)) { + if (ts_cursor_on_multicell(self, s) && !is_combining_char(ch)) { if (s->cp[self->cursor->x].y) { move_cursor_past_multicell(self, 1); init_text_loop_line(self, s); - } else { - if (!is_combining_char(ch)) nuke_multicell_char_at(self, self->cursor->x, self->cursor->y, s->cp[self->cursor->x].x != 0); - } + } else nuke_multicell_char_at(self, self->cursor->x, self->cursor->y, s->cp[self->cursor->x].x != 0); } int char_width = 1; diff --git a/kitty_tests/multicell.py b/kitty_tests/multicell.py index 214c0eafa..98c9f6448 100644 --- a/kitty_tests/multicell.py +++ b/kitty_tests/multicell.py @@ -106,6 +106,14 @@ def assert_cursor_at(x, y): ac(x, 0, is_multicell=True, width=2, scale=2, subscale_n=3, x=x, y=0, text='', natural_width=False) for x in range(0, 4): ac(x, 1, is_multicell=True, width=2, scale=2, subscale_n=3, x=x, y=1, text='', natural_width=False) + for y in range(2): + for x in range(1, 3): + s.reset() + multicell(s, 'a', scale=2) + s.cursor.x, s.cursor.y = x, y + s.draw('\u0301') + assert_cursor_at(x, y) + ac(0, 0, text='a' if y else 'a\u0301', is_multicell=True) # Test wrapping s.reset()