]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix right-margin display on TTY frames
authorEli Zaretskii <eliz@gnu.org>
Tue, 6 Jul 2021 17:11:51 +0000 (20:11 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 6 Jul 2021 17:11:51 +0000 (20:11 +0300)
* 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)

src/dispnew.c

index 1378c34e9842c75ca45e38e2136f8adcbe4d2a02..0c31319917370fcce392b758169807a32383f94e 100644 (file)
@@ -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;
+       }
     }
 }