From e2e701460bb00855f98d07f29b3446a76ea04122 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 29 Jun 2020 14:17:40 +0530 Subject: [PATCH] Fix the CSI J (Erase in display ED) escape code not removing line continued markers Fixes #2809 Remains to write tests for this. --- docs/changelog.rst | 3 +++ kitty/line-buf.c | 6 ++++++ kitty/lineops.h | 1 + kitty/screen.c | 1 + 4 files changed, 11 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 1dca3091a..7343d2f9f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -23,6 +23,9 @@ To update |kitty|, :doc:`follow the instructions `. - Wayland: Fix a crash when using animated mouse cursors (:iss:`2810`) +- Fix the CSI J (Erase in display ED) escape code not removing line continued + markers (:iss:`2809`) + 0.18.1 [2020-06-23] -------------------- diff --git a/kitty/line-buf.c b/kitty/line-buf.c index dcd288ad9..55a36aab4 100644 --- a/kitty/line-buf.c +++ b/kitty/line-buf.c @@ -51,6 +51,12 @@ linebuf_mark_line_clean(LineBuf *self, index_type y) { self->line_attrs[y] &= ~TEXT_DIRTY_MASK; } +void +linebuf_mark_line_as_not_continued(LineBuf *self, index_type y) { + self->line_attrs[y] &= ~CONTINUED_MASK; +} + + 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 d215c491b..daeaa219b 100644 --- a/kitty/lineops.h +++ b/kitty/lineops.h @@ -96,6 +96,7 @@ void linebuf_set_attribute(LineBuf *, unsigned int , unsigned int ); void linebuf_rewrap(LineBuf *self, LineBuf *other, index_type *, index_type *, HistoryBuf *, index_type *, index_type *); void linebuf_mark_line_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); void linebuf_refresh_sprite_positions(LineBuf *self); void historybuf_add_line(HistoryBuf *self, const Line *line); diff --git a/kitty/screen.c b/kitty/screen.c index 5bd49db56..36fb9a52b 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1188,6 +1188,7 @@ screen_erase_in_display(Screen *self, unsigned int how, bool private) { 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); } self->is_dirty = true; self->selection = EMPTY_SELECTION;