diff options
| author | Gerd Moellmann | 2000-06-07 12:42:30 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-06-07 12:42:30 +0000 |
| commit | 3091c2a6523ee0ba7c017b081997e22480ef9419 (patch) | |
| tree | b64d6f96c65f85983e6a9624dc4dc9dacc74a5ba /src | |
| parent | f38952fe7bd43bbe4013d9a1d99d9bfc7dd7d742 (diff) | |
| download | emacs-3091c2a6523ee0ba7c017b081997e22480ef9419.tar.gz emacs-3091c2a6523ee0ba7c017b081997e22480ef9419.zip | |
(displayed_window_lines): Take empty lines at
the bottom of a window into account.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/window.c | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2a5875dac96..4c36ba9cd81 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2000-06-07 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-06-07 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * window.c (displayed_window_lines): Take empty lines at | ||
| 4 | the bottom of a window into account. | ||
| 5 | |||
| 3 | * window.c (displayed_window_lines): New function. | 6 | * window.c (displayed_window_lines): New function. |
| 4 | (Fmove_to_window_line): Use displayed_window_lines to determine | 7 | (Fmove_to_window_line): Use displayed_window_lines to determine |
| 5 | the number of lines to move, instead of using the window's height. | 8 | 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) | |||
| 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 | ||