comparison src/window.c @ 36202:8d5b7f742286

(Fmove_to_window_line): Undo last change. (displayed_window_lines): Call line_bottom_y to determine the line's bottom position.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 19 Feb 2001 16:43:40 +0000
parents 6eb00bee0989
children 9fa7c8e6a6d5
comparison
equal deleted inserted replaced
36201:32505f3d0441 36202:8d5b7f742286
4493 old_buffer = NULL; 4493 old_buffer = NULL;
4494 4494
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 bottom_y = line_bottom_y (&it);
4499
4500 /* Add in empty lines at the bottom of the window. */
4501 if (bottom_y < height)
4502 {
4503 int uy = CANON_Y_UNIT (it.f);
4504 it.vpos += (height - bottom_y + uy - 1) / uy;
4505 }
4498 4506
4499 if (old_buffer) 4507 if (old_buffer)
4500 set_buffer_internal (old_buffer); 4508 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
4508 /* Add in empty lines at the bottom of the window. */
4509 if (bottom_y < height)
4510 {
4511 struct frame *f = XFRAME (w->frame);
4512 int rest = height - bottom_y;
4513 int lines = rest / CANON_Y_UNIT (f);
4514 it.vpos += lines;
4515 }
4516 4509
4517 return it.vpos; 4510 return it.vpos;
4518 } 4511 }
4519 4512
4520 4513
4657 arg = Fprefix_numeric_value (arg); 4650 arg = Fprefix_numeric_value (arg);
4658 if (XINT (arg) < 0) 4651 if (XINT (arg) < 0)
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 }
4672 4661
4673 4662