From 0a5c16363c131229856fcdecd12a0b895c60ffd2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 Mar 2022 15:20:25 +0530 Subject: [PATCH] Fix continued lines not having their continued status reset on line feed Fixes #4837 --- docs/changelog.rst | 3 +++ kitty/screen.c | 1 + kitty_tests/screen.py | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 1c8ddd683..2033f2514 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -87,6 +87,9 @@ Detailed list of changes - Bash integration: Prevent shell integration code from running twice if user enables both automatic and manual integration +- Fix continued lines not having their continued status reset on line feed (:iss:`4837`) + + 0.24.4 [2022-03-03] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/screen.c b/kitty/screen.c index df521d94f..9daaa0f43 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1355,6 +1355,7 @@ screen_linefeed(Screen *self) { bool in_margins = cursor_within_margins(self); screen_index(self); if (self->modes.mLNM) screen_carriage_return(self); + if (self->cursor->y < self->lines) linebuf_mark_line_as_not_continued(self->linebuf, self->cursor->y); screen_ensure_bounds(self, false, in_margins); } diff --git a/kitty_tests/screen.py b/kitty_tests/screen.py index 449a24909..eb928f99d 100644 --- a/kitty_tests/screen.py +++ b/kitty_tests/screen.py @@ -293,6 +293,18 @@ class TestScreen(BaseTest): self.ae(str(s.linebuf), '55555\n66666\n77777\n88888\n99999') s.resize(5, 2) self.ae(str(s.linebuf), '88\n88\n99\n99\n9') + s = self.create_screen() + s.draw('a' * s.columns) + s.linefeed(), s.carriage_return() + s.draw('bb') + s.resize(s.lines, s.columns - 2) + self.ae(str(s.linebuf), 'aaa\naa\nbb\n\n') + s.cursor.y = s.cursor.x = 0 + s.draw('x' * len(str(s.line(0)))) + s.linefeed(), s.carriage_return() + s.draw('x' * len(str(s.line(1)))) + s.resize(s.lines, s.columns + 4) + self.ae(str(s.linebuf), 'xxx\nxx\nbb\n\n') def test_cursor_after_resize(self):