From 0d0891c1bb8a6cb29f26c243afd6edaf1d94092a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 May 2026 13:26:46 +0300 Subject: [PATCH] ; Fix an issue with counting glyphs on TTY frames * src/dispnew.c (fake_current_matrices): Fix the 'used' count of glyphs for the right margin and the text-area. (Bug#80900) --- src/dispnew.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dispnew.c b/src/dispnew.c index 736647408cb..284a0eb175f 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -1937,6 +1937,11 @@ fake_current_matrices (Lisp_Object window) { r->used[LEFT_MARGIN_AREA] = m->left_margin_glyphs; r->used[RIGHT_MARGIN_AREA] = m->right_margin_glyphs; + /* Non-rightmost windows have the border glyph at the + end of the right margin, if any, in addition to the + glyphs reserved for the margin itself. */ + if (m->right_margin_glyphs > 0 && !WINDOW_RIGHTMOST_P (w)) + r->used[RIGHT_MARGIN_AREA]++; r->used[TEXT_AREA] = (m->matrix_w - r->used[LEFT_MARGIN_AREA] - r->used[RIGHT_MARGIN_AREA]);