From e63a436ba9aefe46ef2018da5b525c2f7ab6768f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 15 Jun 2025 06:24:35 +0530 Subject: [PATCH] ... --- kitty/screen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kitty/screen.c b/kitty/screen.c index fb16c7ca2..dbeca2792 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -860,8 +860,9 @@ halve_multicell_width(Screen *self, index_type x_, index_type y_) { y_min_limit = expected_y_min_limit; unsigned new_width = cp[x_].width / 2; while (cp[x_].x && x_ > 0) x_--; - index_type x_limit = MIN(self->columns, x_ + mcd_x_limit(&cp[x_])); - index_type half_x_limit = MIN(self->columns, x_ + mcd_x_limit(&cp[x_]) / 2); + const index_type ws = mcd_x_limit(&cp[x_]); + const index_type x_limit = MIN(self->columns, x_ + ws); + const index_type half_x_limit = MIN(self->columns, x_ + ws / 2); int y_max_limit = MIN(self->lines, y_ + cp[x_].scale); for (int y = y_min_limit + 1; y < y_max_limit; y++) { Line *line = range_line_(self, y); cp = line->cpu_cells; gp = line->gpu_cells;