diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/window.c b/src/window.c index a84cd668c81..61c4d3c83b8 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4495,25 +4495,18 @@ displayed_window_lines (w) | |||
| 4495 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 4495 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 4496 | start_display (&it, w, start); | 4496 | start_display (&it, w, start); |
| 4497 | move_it_vertically (&it, height); | 4497 | move_it_vertically (&it, height); |
| 4498 | 4498 | bottom_y = line_bottom_y (&it); | |
| 4499 | if (old_buffer) | ||
| 4500 | set_buffer_internal (old_buffer); | ||
| 4501 | |||
| 4502 | bottom_y = it.current_y + it.max_ascent + it.max_descent; | ||
| 4503 | |||
| 4504 | if (bottom_y > it.current_y && bottom_y <= it.last_visible_y) | ||
| 4505 | /* Hit a line without a terminating newline. */ | ||
| 4506 | it.vpos++; | ||
| 4507 | 4499 | ||
| 4508 | /* Add in empty lines at the bottom of the window. */ | 4500 | /* Add in empty lines at the bottom of the window. */ |
| 4509 | if (bottom_y < height) | 4501 | if (bottom_y < height) |
| 4510 | { | 4502 | { |
| 4511 | struct frame *f = XFRAME (w->frame); | 4503 | int uy = CANON_Y_UNIT (it.f); |
| 4512 | int rest = height - bottom_y; | 4504 | it.vpos += (height - bottom_y + uy - 1) / uy; |
| 4513 | int lines = rest / CANON_Y_UNIT (f); | ||
| 4514 | it.vpos += lines; | ||
| 4515 | } | 4505 | } |
| 4516 | 4506 | ||
| 4507 | if (old_buffer) | ||
| 4508 | set_buffer_internal (old_buffer); | ||
| 4509 | |||
| 4517 | return it.vpos; | 4510 | return it.vpos; |
| 4518 | } | 4511 | } |
| 4519 | 4512 | ||
| @@ -4659,13 +4652,9 @@ zero means top of window, negative means relative to bottom of window.") | |||
| 4659 | XSETINT (arg, XINT (arg) + lines); | 4652 | XSETINT (arg, XINT (arg) + lines); |
| 4660 | } | 4653 | } |
| 4661 | 4654 | ||
| 4662 | #if 0 /* I don't understand why this is done. Among other things, | 4655 | /* Skip past a partially visible first line. */ |
| 4663 | it means that C-u 0 M-r moves to line 1, and C-u -1 M-r | ||
| 4664 | moves to the line below the window end. 2000-02-05, gerd */ | ||
| 4665 | if (w->vscroll) | 4656 | if (w->vscroll) |
| 4666 | /* Skip past a partially visible first line. */ | ||
| 4667 | XSETINT (arg, XINT (arg) + 1); | 4657 | XSETINT (arg, XINT (arg) + 1); |
| 4668 | #endif | ||
| 4669 | 4658 | ||
| 4670 | return Fvertical_motion (arg, window); | 4659 | return Fvertical_motion (arg, window); |
| 4671 | } | 4660 | } |