aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorGerd Moellmann2000-06-07 12:42:30 +0000
committerGerd Moellmann2000-06-07 12:42:30 +0000
commit3091c2a6523ee0ba7c017b081997e22480ef9419 (patch)
treeb64d6f96c65f85983e6a9624dc4dc9dacc74a5ba /src/window.c
parentf38952fe7bd43bbe4013d9a1d99d9bfc7dd7d742 (diff)
downloademacs-3091c2a6523ee0ba7c017b081997e22480ef9419.tar.gz
emacs-3091c2a6523ee0ba7c017b081997e22480ef9419.zip
(displayed_window_lines): Take empty lines at
the bottom of a window into account.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c
index a5ce48813b8..1289d18679b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4227,10 +4227,21 @@ displayed_window_lines (w)
4227{ 4227{
4228 struct it it; 4228 struct it it;
4229 struct text_pos start; 4229 struct text_pos start;
4230 int height = window_box_height (w);
4230 4231
4231 SET_TEXT_POS_FROM_MARKER (start, w->start); 4232 SET_TEXT_POS_FROM_MARKER (start, w->start);
4232 start_display (&it, w, start); 4233 start_display (&it, w, start);
4233 move_it_vertically (&it, window_box_height (w)); 4234 move_it_vertically (&it, height);
4235
4236 /* Add in empty lines at the bottom of the window. */
4237 if (it.current_y < height)
4238 {
4239 struct frame *f = XFRAME (w->frame);
4240 int rest = height - it.current_y;
4241 int lines = (rest + CANON_Y_UNIT (f) - 1) / CANON_Y_UNIT (f);
4242 it.vpos += lines;
4243 }
4244
4234 return it.vpos; 4245 return it.vpos;
4235} 4246}
4236 4247