From: Gerd Moellmann Date: Fri, 28 Apr 2000 13:39:21 +0000 (+0000) Subject: (make_cursor_line_fully_visible): Handle case of rows X-Git-Tag: emacs-pretest-21.0.90~4101 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a943a5ca3e381ab60160391ce10d3ccf4c0399c6;p=emacs.git (make_cursor_line_fully_visible): Handle case of rows taller than the window. --- diff --git a/src/ChangeLog b/src/ChangeLog index 79798d69bcf..ecd00d15bed 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2000-04-28 Gerd Moellmann + + * xdisp.c (make_cursor_line_fully_visible): Handle case of rows + taller than the window. + 2000-04-28 Kenichi Handa * xfaces.c (realize_x_face): Fix the argument of the second diff --git a/src/xdisp.c b/src/xdisp.c index 0789230f010..2f766bf46e8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8148,21 +8148,24 @@ make_cursor_line_fully_visible (w) matrix = w->desired_matrix; row = MATRIX_ROW (matrix, w->cursor.vpos); - /* If row->y == top y of window display area, the window isn't tall - enough to display a single line. There is nothing we can do - about it. */ - header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); - if (row->y == header_line_height) - return; - - if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row)) + if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P (w, row) + /* The row may be partially visible at the top because we + already have chosen a vscroll to align the bottom of the + row with the bottom of the window. This happens for rows + taller than the window. */ + && row->y + row->height < window_box_height (w)) { int dy = row->height - row->visible_height; w->vscroll = 0; w->cursor.y += dy; shift_glyph_matrix (w, matrix, 0, matrix->nrows, dy); } - else if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row)) + else if (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P (w, row) + /* The row may be partially visible at the bottom because + we chose a vscroll to align the row's top with the + window's top. This happens for rows taller than the + window. */ + && row->y > WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w)) { int dy = - (row->height - row->visible_height); w->vscroll = dy;