From 8e55cf75525f751bb3425eb566aebe22bd701d15 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 14 Jun 2025 20:19:21 +0530 Subject: [PATCH] Fix #8731 --- docs/changelog.rst | 2 ++ kitty/screen.c | 2 +- kitty_tests/screen.py | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 535fba2de..8721be262 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -126,6 +126,8 @@ Detailed list of changes - Wayland GNOME: Fix incorrect OS Window tracking because GNOME has started activating windows on non-current workspaces (:iss:`8716`) +- Fix a regression in 0.40.0 that broke rendering of VS15 variation selectors in some circumstances (:iss:`8731`) + 0.42.1 [2025-05-17] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/screen.c b/kitty/screen.c index 565380758..fb16c7ca2 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -861,7 +861,7 @@ halve_multicell_width(Screen *self, index_type x_, index_type y_) { 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 = x_limit / 2; + index_type half_x_limit = MIN(self->columns, x_ + mcd_x_limit(&cp[x_]) / 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; diff --git a/kitty_tests/screen.py b/kitty_tests/screen.py index dc3b84f98..1845c1117 100644 --- a/kitty_tests/screen.py +++ b/kitty_tests/screen.py @@ -694,6 +694,11 @@ class TestScreen(BaseTest): def test_variation_selectors(self): s = self.create_screen() + def tt(text_to_draw): + s.reset() + s.draw(text_to_draw) + self.ae(str(s.line(0)), text_to_draw) + tt('abc\U0001f44d\ufe0ed') def t(*a): s.reset() for i in range(0, len(a), 2):