From: Gerd Moellmann Date: Wed, 7 Jun 2000 12:42:30 +0000 (+0000) Subject: (displayed_window_lines): Take empty lines at X-Git-Tag: emacs-pretest-21.0.90~3464 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3091c2a6523ee0ba7c017b081997e22480ef9419;p=emacs.git (displayed_window_lines): Take empty lines at the bottom of a window into account. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2a5875dac96..4c36ba9cd81 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2000-06-07 Gerd Moellmann + * window.c (displayed_window_lines): Take empty lines at + the bottom of a window into account. + * window.c (displayed_window_lines): New function. (Fmove_to_window_line): Use displayed_window_lines to determine the number of lines to move, instead of using the window's height. 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) { 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; }