aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-10-23 15:14:53 +0000
committerGerd Moellmann2001-10-23 15:14:53 +0000
commit5cb881112a846610f582dd84a350dcb8fa79967c (patch)
tree4273cc2f2d001ad41bf5b2538b6a800ffcebd4c3 /src
parentfc11dff0970613d5d96ba87bbb2fc500e3b30a42 (diff)
downloademacs-5cb881112a846610f582dd84a350dcb8fa79967c.tar.gz
emacs-5cb881112a846610f582dd84a350dcb8fa79967c.zip
(sync_window_with_frame_matrix_rows): Fix
handling of windows which aren't full-width, fix handling of marginal areas.
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 033847dd942..a7652d88d7c 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3005,8 +3005,7 @@ mirrored_line_dance (matrix, unchanged_at_top, nlines, copy_from,
3005 3005
3006 3006
3007/* Synchronize glyph pointers in the current matrix of window W with 3007/* Synchronize glyph pointers in the current matrix of window W with
3008 the current frame matrix. W must be full-width, and be on a tty 3008 the current frame matrix. */
3009 frame. */
3010 3009
3011static void 3010static void
3012sync_window_with_frame_matrix_rows (w) 3011sync_window_with_frame_matrix_rows (w)
@@ -3014,27 +3013,31 @@ sync_window_with_frame_matrix_rows (w)
3014{ 3013{
3015 struct frame *f = XFRAME (w->frame); 3014 struct frame *f = XFRAME (w->frame);
3016 struct glyph_row *window_row, *window_row_end, *frame_row; 3015 struct glyph_row *window_row, *window_row_end, *frame_row;
3016 int area, left, right, x, width;
3017 3017
3018 /* Preconditions: W must be a leaf window and full-width. Its frame 3018 /* Preconditions: W must be a leaf window on a tty frame. */
3019 must have a frame matrix. */
3020 xassert (NILP (w->hchild) && NILP (w->vchild)); 3019 xassert (NILP (w->hchild) && NILP (w->vchild));
3021 xassert (WINDOW_FULL_WIDTH_P (w));
3022 xassert (!FRAME_WINDOW_P (f)); 3020 xassert (!FRAME_WINDOW_P (f));
3023 3021
3024 /* If W is a full-width window, glyph pointers in W's current matrix 3022 left = margin_glyphs_to_reserve (w, 1, w->left_margin_width);
3025 have, by definition, to be the same as glyph pointers in the 3023 right = margin_glyphs_to_reserve (w, 1, w->right_margin_width);
3026 corresponding frame matrix. */ 3024 x = w->current_matrix->matrix_x;
3025 width = w->current_matrix->matrix_w;
3026
3027 window_row = w->current_matrix->rows; 3027 window_row = w->current_matrix->rows;
3028 window_row_end = window_row + w->current_matrix->nrows; 3028 window_row_end = window_row + w->current_matrix->nrows;
3029 frame_row = f->current_matrix->rows + XFASTINT (w->top); 3029 frame_row = f->current_matrix->rows + XFASTINT (w->top);
3030 while (window_row < window_row_end) 3030
3031 { 3031 for (; window_row < window_row_end; ++window_row, ++frame_row)
3032 int area; 3032 {
3033 3033 window_row->glyphs[LEFT_MARGIN_AREA]
3034 for (area = LEFT_MARGIN_AREA; area <= LAST_AREA; ++area) 3034 = frame_row->glyphs[0] + x;
3035 window_row->glyphs[area] = frame_row->glyphs[area]; 3035 window_row->glyphs[TEXT_AREA]
3036 3036 = window_row->glyphs[LEFT_MARGIN_AREA] + left;
3037 ++window_row, ++frame_row; 3037 window_row->glyphs[LAST_AREA]
3038 = window_row->glyphs[LEFT_MARGIN_AREA] + width;
3039 window_row->glyphs[RIGHT_MARGIN_AREA]
3040 = window_row->glyphs[LAST_AREA] - right;
3038 } 3041 }
3039} 3042}
3040 3043