diff --git a/kitty/screen.c b/kitty/screen.c index 04c4af3d1..5d8658847 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -772,7 +772,7 @@ checked_range_line(Screen *self, int y) { static bool range_line_is_continued(Screen *self, int y) { - if (-(int)self->historybuf->count <= y && y < (int)self->lines) return false; + if (!(-(int)self->historybuf->count <= y && y < (int)self->lines)) return false; if (y < 0) return historybuf_is_line_continued(self->historybuf, -(y + 1)); return visual_line_is_continued(self, y); } diff --git a/kitty_tests/screen.py b/kitty_tests/screen.py index 2a1133a65..4111baa11 100644 --- a/kitty_tests/screen.py +++ b/kitty_tests/screen.py @@ -1193,6 +1193,14 @@ class TestScreen(BaseTest): s.cmd_output(2, a.append) return ''.join(a) + s = self.create_screen(cols=5, lines=5, scrollback=15) + draw_prompt('P' * s.columns) + draw_output(s.lines + 1, 'a') # ensure prompt is in scrollback + draw_prompt('Q' * s.columns) + draw_output(s.lines + 1, 'b') # ensure prompt is in scrollback + draw_prompt('R' * s.columns) + self.ae(lco(), '0b\n1b\n2b\n3b\n4b\n5b') + s = self.create_screen() s.draw('abcd'), s.index(), s.carriage_return() s.draw('12'), s.index(), s.carriage_return()