emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 10753bc: Fix right-margin display on TTY frames


From: Eli Zaretskii
Subject: master 10753bc: Fix right-margin display on TTY frames
Date: Tue, 6 Jul 2021 13:12:30 -0400 (EDT)

branch: master
commit 10753bc6888c997c31408a3ec59df42a4bef0005
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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)
---
 src/dispnew.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/dispnew.c b/src/dispnew.c
index 1378c34..0c31319 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;
+       }
     }
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]