From b52a9031ca1e31b8251c0ea58cc1a1c6bf04138c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 8 Jan 2026 12:40:40 +0530 Subject: [PATCH] Fix selections test failing due to pixel scroll Note this only fixes the test, there is still the actual issue of the selection not being rendered for the top most line if that line is partially scrolled offscreen --- kitty/screen.c | 2 +- kitty_tests/multicell.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/screen.c b/kitty/screen.c index eb6e81ed2..c1cc17dd1 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -5780,7 +5780,7 @@ line_edge_colors(Screen *self, PyObject *a UNUSED) { static PyObject* current_selections(Screen *self, PyObject *a UNUSED) { - PyObject *ans = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)self->lines * self->columns); + PyObject *ans = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)render_lines_for_screen(self) * self->columns); if (!ans) return NULL; screen_apply_selection(self, PyBytes_AS_STRING(ans), PyBytes_GET_SIZE(ans)); return ans; diff --git a/kitty_tests/multicell.py b/kitty_tests/multicell.py index cdd91185e..2a046f29b 100644 --- a/kitty_tests/multicell.py +++ b/kitty_tests/multicell.py @@ -688,7 +688,7 @@ def test_multicell(self: TestMulticell) -> None: pos = y * s.columns for x in range(x1, x2 + 1): expected[pos + x] = bp - for i, (e, a) in enumerate(zip(as_lists(bytes(expected)), as_lists(actual))): + for i, (e, a) in enumerate(zip(as_lists(bytes(expected)), as_lists(actual)[1:])): self.ae(e, a, f'Row: {i}') def ast(*expected, strip_trailing_whitespace=False, as_ansi=False):