From: Eli Zaretskii Date: Tue, 6 Jul 2021 17:11:51 +0000 (+0300) Subject: Fix right-margin display on TTY frames X-Git-Tag: emacs-28.0.90~1942 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=10753bc6888c997c31408a3ec59df42a4bef0005;p=emacs.git Fix right-margin display on TTY frames * src/dispnew.c (prepare_desired_row, adjust_glyph_matrix): Adjust the glyph pointer of the right-margin area for all windows but the rightmost ones on TTY frames, to account for the border glyph. (Bug#48257) --- diff --git a/src/dispnew.c b/src/dispnew.c index 1378c34e984..0c313199173 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -473,6 +473,10 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y = row->glyphs[LEFT_MARGIN_AREA] + left; row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[TEXT_AREA] + dim.width - left - right; + /* Leave room for a border glyph. */ + if (!FRAME_WINDOW_P (XFRAME (w->frame)) + && !WINDOW_RIGHTMOST_P (w)) + row->glyphs[RIGHT_MARGIN_AREA] -= 1; row->glyphs[LAST_AREA] = row->glyphs[LEFT_MARGIN_AREA] + dim.width; } @@ -1140,7 +1144,13 @@ prepare_desired_row (struct window *w, struct glyph_row *row, bool mode_line_p) row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA] + left; if (w->right_margin_cols > 0 && (right != row->glyphs[LAST_AREA] - row->glyphs[RIGHT_MARGIN_AREA])) - row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right; + { + row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right; + /* Leave room for a border glyph. */ + if (!FRAME_WINDOW_P (XFRAME (w->frame)) + && !WINDOW_RIGHTMOST_P (w)) + row->glyphs[RIGHT_MARGIN_AREA] -= 1; + } } }