]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix display glitches with side-by-side windows on TTY frames
authorEli Zaretskii <eliz@gnu.org>
Sun, 31 Oct 2021 07:42:09 +0000 (09:42 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 31 Oct 2021 07:42:09 +0000 (09:42 +0200)
* src/dispnew.c (adjust_glyph_matrix, prepare_desired_row): Leave
room for the border glyph only if the window does actually have
the right margin.  (Bug#51521)

src/dispnew.c

index 69c2023fdf38076e03ff6039bd2467b8e908e8ab..53eb8984747c58da2376486f4c42432bba7b14e3 100644 (file)
@@ -475,7 +475,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
                = 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))
+                 && !WINDOW_RIGHTMOST_P (w)
+                 && right > 0)
                row->glyphs[RIGHT_MARGIN_AREA] -= 1;
              row->glyphs[LAST_AREA]
                = row->glyphs[LEFT_MARGIN_AREA] + dim.width;
@@ -1148,7 +1149,8 @@ prepare_desired_row (struct window *w, struct glyph_row *row, bool mode_line_p)
          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))
+             && !WINDOW_RIGHTMOST_P (w)
+             && right > 0)
            row->glyphs[RIGHT_MARGIN_AREA] -= 1;
        }
     }