aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-08-07 21:52:14 +0000
committerGerd Moellmann2000-08-07 21:52:14 +0000
commitb28cb6ed7a7099b13c663047dedd9573e774833f (patch)
tree72239a52a51966bc0f7cc19c23c43cb901ce44f2 /src
parent5e9e032a38c132e9d1b2709c000ee7795b6be0fb (diff)
downloademacs-b28cb6ed7a7099b13c663047dedd9573e774833f.tar.gz
emacs-b28cb6ed7a7099b13c663047dedd9573e774833f.zip
(start_display): WHen starting display on a continuation
line, clear ascent and descent members of the iterator structure; the height of the continued line does not affect the height of the continuation line. (make_cursor_line_fully_visible): Do nothing if cursor is on a line taller than the window. (redisplay_window) <forced window start>: Handle case that the middle of the window is not found in any row. (dump_glyph_row): Show more information. (compute_line_metrics): Use MATRIX_FIRST_TEXT_ROW to determine the first text line in a glyph matrix.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c83
1 files changed, 51 insertions, 32 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index da189e5b48f..14d88ddf9b6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1487,15 +1487,25 @@ start_display (it, w, pos)
1487 \003, or in the middle of an overlay string). In this case 1487 \003, or in the middle of an overlay string). In this case
1488 move_it_to above will not have taken us to the start of 1488 move_it_to above will not have taken us to the start of
1489 the continuation line but to the end of the continued line. */ 1489 the continuation line but to the end of the continued line. */
1490 if (!it->truncate_lines_p && it->current_x > 0) 1490 if (!it->truncate_lines_p)
1491 { 1491 {
1492 if (it->current.dpvec_index >= 0 1492 if (it->current_x > 0)
1493 || it->current.overlay_string_index >= 0)
1494 { 1493 {
1495 set_iterator_to_next (it); 1494 if (it->current.dpvec_index >= 0
1496 move_it_in_display_line_to (it, -1, -1, 0); 1495 || it->current.overlay_string_index >= 0)
1496 {
1497 set_iterator_to_next (it);
1498 move_it_in_display_line_to (it, -1, -1, 0);
1499 }
1500
1501 it->continuation_lines_width += it->current_x;
1497 } 1502 }
1498 it->continuation_lines_width += it->current_x; 1503
1504 /* We're starting a new display line, not affected by the
1505 height of the continued line, so clear the appropriate
1506 fields in the iterator structure. */
1507 it->max_ascent = it->max_descent = 0;
1508 it->max_phys_ascent = it->max_phys_descent = 0;
1499 } 1509 }
1500 1510
1501 it->current_y = first_y; 1511 it->current_y = first_y;
@@ -8338,6 +8348,7 @@ make_cursor_line_fully_visible (w)
8338{ 8348{
8339 struct glyph_matrix *matrix; 8349 struct glyph_matrix *matrix;
8340 struct glyph_row *row; 8350 struct glyph_row *row;
8351 int window_height, header_line_height;
8341 8352
8342 /* It's not always possible to find the cursor, e.g, when a window 8353 /* It's not always possible to find the cursor, e.g, when a window
8343 is full of overlay strings. Don't do anything in that case. */ 8354 is full of overlay strings. Don't do anything in that case. */
@@ -8347,31 +8358,32 @@ make_cursor_line_fully_visible (w)
8347 matrix = w->desired_matrix; 8358 matrix = w->desired_matrix;
8348 row = MATRIX_ROW (matrix, w->cursor.vpos); 8359 row = MATRIX_ROW (matrix, w->cursor.vpos);
8349 8360
8350 if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row) 8361 /* If the cursor row is not partially visible, there's nothing
8351 /* The row may be partially visible at the top because we 8362 to do. */
8352 already have chosen a vscroll to align the bottom of the 8363 if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row))
8353 row with the bottom of the window. This happens for rows 8364 return;
8354 taller than the window. */ 8365
8355 && row->y + row->height < window_box_height (w)) 8366 /* If the row the cursor is in is taller than the window's height,
8367 it's not clear what to do, so do nothing. */
8368 window_height = window_box_height (w);
8369 if (row->height >= window_height)
8370 return;
8371
8372 if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row))
8356 { 8373 {
8357 int dy = row->height - row->visible_height; 8374 int dy = row->height - row->visible_height;
8358 w->vscroll = 0; 8375 w->vscroll = 0;
8359 w->cursor.y += dy; 8376 w->cursor.y += dy;
8360 shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy); 8377 shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy);
8361 } 8378 }
8362 else if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row) 8379 else /* MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) */
8363 /* The row may be partially visible at the bottom because
8364 we chose a vscroll to align the row's top with the
8365 window's top. This happens for rows taller than the
8366 window. */
8367 && row->y > WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w))
8368 { 8380 {
8369 int dy = - (row->height - row->visible_height); 8381 int dy = - (row->height - row->visible_height);
8370 w->vscroll = dy; 8382 w->vscroll = dy;
8371 w->cursor.y += dy; 8383 w->cursor.y += dy;
8372 shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy); 8384 shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy);
8373 } 8385 }
8374 8386
8375 /* When we change the cursor y-position of the selected window, 8387 /* When we change the cursor y-position of the selected window,
8376 change this_line_y as well so that the display optimization for 8388 change this_line_y as well so that the display optimization for
8377 the cursor line of the selected window in redisplay_internal uses 8389 the cursor line of the selected window in redisplay_internal uses
@@ -8902,13 +8914,15 @@ redisplay_window (window, just_this_one_p)
8902 8914
8903 if (w->cursor.vpos < 0 && !w->frozen_window_start_p) 8915 if (w->cursor.vpos < 0 && !w->frozen_window_start_p)
8904 { 8916 {
8905 /* If point does not appear, or on a line that is not fully 8917 /* If point does not appear, try to move point so it does
8906 visible, move point so it does appear. The desired 8918 appear. The desired matrix has been built above, so we
8907 matrix has been built above, so we can use it. */ 8919 can use it here. */
8908 int height = window_box_height (w) / 2; 8920 int window_height;
8909 struct glyph_row *row = MATRIX_ROW (w->desired_matrix, 0); 8921 struct glyph_row *row;
8910 8922
8911 while (row->y < height) 8923 window_height = window_box_height (w) / 2;
8924 row = MATRIX_FIRST_TEXT_ROW (w->desired_matrix);
8925 while (MATRIX_ROW_BOTTOM_Y (row) < window_height)
8912 ++row; 8926 ++row;
8913 8927
8914 TEMP_SET_PT_BOTH (MATRIX_ROW_START_CHARPOS (row), 8928 TEMP_SET_PT_BOTH (MATRIX_ROW_START_CHARPOS (row),
@@ -10780,10 +10794,11 @@ dump_glyph_row (matrix, vpos, with_glyphs_p)
10780 10794
10781 row = MATRIX_ROW (matrix, vpos); 10795 row = MATRIX_ROW (matrix, vpos);
10782 10796
10783 fprintf (stderr, "Row Start End Used oEI><O\\CTZFes X Y W\n"); 10797 fprintf (stderr, "Row Start End Used oEI><O\\CTZFes X Y W H V A P\n");
10784 fprintf (stderr, "=============================================\n"); 10798 fprintf (stderr, "=======================================================================\n");
10785 10799
10786 fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d\n", 10800 fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1 \
108011d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d %4d %4d %4d %4d %4d %4d %4d\n",
10787 row - matrix->rows, 10802 row - matrix->rows,
10788 MATRIX_ROW_START_CHARPOS (row), 10803 MATRIX_ROW_START_CHARPOS (row),
10789 MATRIX_ROW_END_CHARPOS (row), 10804 MATRIX_ROW_END_CHARPOS (row),
@@ -10803,7 +10818,11 @@ dump_glyph_row (matrix, vpos, with_glyphs_p)
10803 row->starts_in_middle_of_char_p, 10818 row->starts_in_middle_of_char_p,
10804 row->x, 10819 row->x,
10805 row->y, 10820 row->y,
10806 row->pixel_width); 10821 row->pixel_width,
10822 row->height,
10823 row->visible_height,
10824 row->ascent,
10825 row->phys_ascent);
10807 fprintf (stderr, "%9d %5d\n", row->start.overlay_string_index, 10826 fprintf (stderr, "%9d %5d\n", row->start.overlay_string_index,
10808 row->end.overlay_string_index); 10827 row->end.overlay_string_index);
10809 fprintf (stderr, "%9d %5d\n", 10828 fprintf (stderr, "%9d %5d\n",
@@ -11131,7 +11150,7 @@ compute_line_metrics (it)
11131 /* If first line's physical ascent is larger than its logical 11150 /* If first line's physical ascent is larger than its logical
11132 ascent, use the physical ascent, and make the row taller. 11151 ascent, use the physical ascent, and make the row taller.
11133 This makes accented characters fully visible. */ 11152 This makes accented characters fully visible. */
11134 if (row == it->w->desired_matrix->rows 11153 if (row == MATRIX_FIRST_TEXT_ROW (it->w->desired_matrix)
11135 && row->phys_ascent > row->ascent) 11154 && row->phys_ascent > row->ascent)
11136 { 11155 {
11137 row->height += row->phys_ascent - row->ascent; 11156 row->height += row->phys_ascent - row->ascent;
@@ -11445,7 +11464,7 @@ display_line (it)
11445 int n_glyphs_before, hpos_before, x_before; 11464 int n_glyphs_before, hpos_before, x_before;
11446 int x, i, nglyphs; 11465 int x, i, nglyphs;
11447 int ascent, descent, phys_ascent, phys_descent; 11466 int ascent, descent, phys_ascent, phys_descent;
11448 11467
11449 /* Retrieve the next thing to display. Value is zero if end of 11468 /* Retrieve the next thing to display. Value is zero if end of
11450 buffer reached. */ 11469 buffer reached. */
11451 if (!get_next_display_element (it)) 11470 if (!get_next_display_element (it))