diff --git a/docs/changelog.rst b/docs/changelog.rst index a2fe63b74..22a717f5b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,7 +10,7 @@ To update |kitty|, :doc:`follow the instructions `. - Integrate kitty closely with common shells such as zsh, fish and bash. This allows lots of niceties such as jumping to previous prompts, opening the output of the last command in a new window, etc. See :ref:`shell_integration` - for details. + for details. Packagers please read :ref:`packagers`. - A new shortcut :sc:`focus_visible_window` to visually focus a window using the keyboard. Pressing it causes numbers to appear over each visible window diff --git a/kitty/line-buf.c b/kitty/line-buf.c index dd4fe9c95..64bec8a98 100644 --- a/kitty/line-buf.c +++ b/kitty/line-buf.c @@ -57,6 +57,12 @@ linebuf_mark_line_as_not_continued(LineBuf *self, index_type y) { self->line_attrs[y].continued = false; } +void +linebuf_clear_attrs_and_dirty(LineBuf *self, index_type y) { + self->line_attrs[y].val = 0; + self->line_attrs[y].has_dirty_text = true; +} + static PyObject* clear(LineBuf *self, PyObject *a UNUSED) { #define clear_doc "Clear all lines in this LineBuf" diff --git a/kitty/lineops.h b/kitty/lineops.h index 578a2e29d..9c01b7e82 100644 --- a/kitty/lineops.h +++ b/kitty/lineops.h @@ -103,6 +103,7 @@ void linebuf_delete_lines(LineBuf *self, index_type num, index_type y, index_typ void linebuf_copy_line_to(LineBuf *, Line *, index_type); void linebuf_rewrap(LineBuf *self, LineBuf *other, index_type *, index_type *, HistoryBuf *, index_type *, index_type *, index_type *, index_type *, ANSIBuf*); void linebuf_mark_line_dirty(LineBuf *self, index_type y); +void linebuf_clear_attrs_and_dirty(LineBuf *self, index_type y); void linebuf_mark_line_clean(LineBuf *self, index_type y); void linebuf_mark_line_as_not_continued(LineBuf *self, index_type y); unsigned int linebuf_char_width_at(LineBuf *self, index_type x, index_type y); diff --git a/kitty/screen.c b/kitty/screen.c index 726133457..412393ca1 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1647,15 +1647,14 @@ screen_erase_in_display(Screen *self, unsigned int how, bool private) { } else { line_apply_cursor(self->linebuf->line, self->cursor, 0, self->columns, true); } - linebuf_mark_line_dirty(self->linebuf, i); - linebuf_mark_line_as_not_continued(self->linebuf, i); + linebuf_clear_attrs_and_dirty(self->linebuf, i); } self->is_dirty = true; clear_selection(&self->selections); } if (how != 2) { screen_erase_in_line(self, how, private); - if (how == 1) linebuf_mark_line_as_not_continued(self->linebuf, self->cursor->y); + if (how == 1) linebuf_clear_attrs_and_dirty(self->linebuf, self->cursor->y); } if (how == 3 && self->linebuf == self->main_linebuf) { historybuf_clear(self->historybuf);