diff src/window.c @ 29488:4eef390d6155

(displayed_window_lines): Take empty lines at the bottom of a window into account.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 07 Jun 2000 12:41:40 +0000
parents 362c61b5411b
children 79b4fa5288c3
line wrap: on
line diff
--- a/src/window.c	Wed Jun 07 12:31:26 2000 +0000
+++ b/src/window.c	Wed Jun 07 12:41:40 2000 +0000
@@ -4227,10 +4227,21 @@
 {
   struct it it;
   struct text_pos start;
+  int height = window_box_height (w);
 
   SET_TEXT_POS_FROM_MARKER (start, w->start);
   start_display (&it, w, start);
-  move_it_vertically (&it, window_box_height (w));
+  move_it_vertically (&it, height);
+
+  /* Add in empty lines at the bottom of the window.  */
+  if (it.current_y < height)
+    {
+      struct frame *f = XFRAME (w->frame);
+      int rest = height - it.current_y;
+      int lines = (rest + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f);
+      it.vpos += lines;
+    }
+  
   return it.vpos;
 }