]> git.eshelyaron.com Git - emacs.git/commitdiff
(make_cursor_line_fully_visible): Handle case of rows
authorGerd Moellmann <gerd@gnu.org>
Fri, 28 Apr 2000 13:39:21 +0000 (13:39 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 28 Apr 2000 13:39:21 +0000 (13:39 +0000)
taller than the window.

src/ChangeLog
src/xdisp.c

index 79798d69bcf0db3f2e8280095f4557872e0e0b44..ecd00d15bed5acfa952b611b96a990abed831172 100644 (file)
@@ -1,3 +1,8 @@
+2000-04-28  Gerd Moellmann  <gerd@gnu.org>
+
+       * xdisp.c (make_cursor_line_fully_visible): Handle case of rows
+       taller than the window.
+
 2000-04-28  Kenichi Handa  <handa@etl.go.jp>
 
        * xfaces.c (realize_x_face): Fix the argument of the second
index 0789230f0102f4c130a86f1e4482cf916b154183..2f766bf46e884ba521285e8d074724f13632a217 100644 (file)
@@ -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;