diff --git a/kitty/line.c b/kitty/line.c index c2212c71f..fd97c6655 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -507,7 +507,7 @@ left_shift(Line *self, PyObject *args) { } void -line_set_char(Line *self, unsigned int at, uint32_t ch, unsigned int width, Cursor *cursor) { +line_set_char(Line *self, unsigned int at, uint32_t ch, unsigned int width, Cursor *cursor, bool is_second) { char_type attrs; if (cursor == NULL) { attrs = (((self->cells[at].ch >> ATTRS_SHIFT) & ~WIDTH_MASK) | (width & WIDTH_MASK)) << ATTRS_SHIFT; @@ -519,7 +519,7 @@ line_set_char(Line *self, unsigned int at, uint32_t ch, unsigned int width, Curs } self->cells[at].ch = (ch & CHAR_MASK) | attrs; self->cells[at].cc = 0; - if (CHAR_IS_BLANK(ch)) { clear_sprite_position(self->cells[at]); } + if (!is_second && CHAR_IS_BLANK(ch)) { clear_sprite_position(self->cells[at]); } else set_sprite_position_at(at); } @@ -535,7 +535,7 @@ set_char(Line *self, PyObject *args) { PyErr_SetString(PyExc_ValueError, "Out of bounds"); return NULL; } - line_set_char(self, at, ch, width, cursor); + line_set_char(self, at, ch, width, cursor, false); Py_RETURN_NONE; } diff --git a/kitty/lineops.h b/kitty/lineops.h index 63fc4ec8f..b522b3718 100644 --- a/kitty/lineops.h +++ b/kitty/lineops.h @@ -58,7 +58,7 @@ xlimit_for_line(Line *line) { PyObject* line_text_at(char_type, combining_type); void line_clear_text(Line *self, unsigned int at, unsigned int num, int ch); void line_apply_cursor(Line *self, Cursor *cursor, unsigned int at, unsigned int num, bool clear_char); -void line_set_char(Line *, unsigned int , uint32_t , unsigned int , Cursor *); +void line_set_char(Line *, unsigned int , uint32_t , unsigned int , Cursor *, bool); void line_right_shift(Line *, unsigned int , unsigned int ); void line_add_combining_char(Line *, uint32_t , unsigned int ); index_type line_url_start_at(Line *self, index_type x); diff --git a/kitty/screen.c b/kitty/screen.c index 8b54689c9..1bad5c864 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -280,10 +280,10 @@ screen_draw(Screen *self, uint32_t och) { if (self->modes.mIRM) { line_right_shift(self->linebuf->line, self->cursor->x, char_width); } - line_set_char(self->linebuf->line, self->cursor->x, ch, char_width, self->cursor); + line_set_char(self->linebuf->line, self->cursor->x, ch, char_width, self->cursor, false); self->cursor->x++; if (char_width == 2) { - line_set_char(self->linebuf->line, self->cursor->x, 0, 0, self->cursor); + line_set_char(self->linebuf->line, self->cursor->x, 0, 0, self->cursor, true); self->cursor->x++; } self->is_dirty = true;