Skip to content

Commit

Permalink
Fix right-margin display on TTY frames
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
Eli-Zaretskii committed Jul 6, 2021
1 parent 69f1bd3 commit 10753bc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/dispnew.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 10753bc

Please sign in to comment.