Mercurial > emacs
comparison src/dispnew.c @ 40214:a87bf217f5a6
(sync_window_with_frame_matrix_rows): Fix
handling of windows which aren't full-width, fix handling
of marginal areas.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 23 Oct 2001 15:14:53 +0000 |
parents | c1d88076fa85 |
children | ae4848857075 |
comparison
equal
deleted
inserted
replaced
40213:6b1fa995737b | 40214:a87bf217f5a6 |
---|---|
3003 unchanged_at_top, nlines, copy_from, retained_p); | 3003 unchanged_at_top, nlines, copy_from, retained_p); |
3004 } | 3004 } |
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 |
3011 static void | 3010 static void |
3012 sync_window_with_frame_matrix_rows (w) | 3011 sync_window_with_frame_matrix_rows (w) |
3013 struct window *w; | 3012 struct window *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; |
3017 | 3016 int area, left, right, x, width; |
3018 /* Preconditions: W must be a leaf window and full-width. Its frame | 3017 |
3019 must have a frame matrix. */ | 3018 /* Preconditions: W must be a leaf window on a tty frame. */ |
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 |
3041 | 3044 |
3042 /* Return the window in the window tree rooted in W containing frame | 3045 /* Return the window in the window tree rooted in W containing frame |