aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-19 14:20:11 +0000
committerGerd Moellmann2000-12-19 14:20:11 +0000
commitd72340d43f4d76b5e6127c40d8c887366c1849ae (patch)
treeb923945cecda9d5430340bce2638355683496a49 /src
parentc74e645b50fd09acfc0283e8c6cf197ce23153bc (diff)
downloademacs-d72340d43f4d76b5e6127c40d8c887366c1849ae.tar.gz
emacs-d72340d43f4d76b5e6127c40d8c887366c1849ae.zip
(window_scroll_pixel_based): Don't use
move_it_vertically.
Diffstat (limited to 'src')
-rw-r--r--src/window.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/window.c b/src/window.c
index 0e8c807cb32..b7046ba1496 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3925,8 +3925,7 @@ window_scroll_pixel_based (window, n, whole, noerror)
3925 3925
3926 /* If PT is not visible in WINDOW, move back one half of 3926 /* If PT is not visible in WINDOW, move back one half of
3927 the screen. */ 3927 the screen. */
3928 XSETFASTINT (tem, PT); 3928 tem = Fpos_visible_in_window_p (make_number (PT), window, Qnil);
3929 tem = Fpos_visible_in_window_p (tem, window, Qnil);
3930 if (NILP (tem)) 3929 if (NILP (tem))
3931 { 3930 {
3932 /* Move backward half the height of the window. Performance note: 3931 /* Move backward half the height of the window. Performance note:
@@ -3970,7 +3969,16 @@ window_scroll_pixel_based (window, n, whole, noerror)
3970 int screen_full = (it.last_visible_y 3969 int screen_full = (it.last_visible_y
3971 - next_screen_context_lines * CANON_Y_UNIT (it.f)); 3970 - next_screen_context_lines * CANON_Y_UNIT (it.f));
3972 int direction = n < 0 ? -1 : 1; 3971 int direction = n < 0 ? -1 : 1;
3973 move_it_vertically (&it, direction * screen_full); 3972 int dy = direction * screen_full;
3973
3974 /* Note that move_it_vertically always moves the iterator to the
3975 start of a line. So, if the last line doesn't have a newline,
3976 we would end up at the start of the line ending at ZV. */
3977 if (dy <= 0)
3978 move_it_vertically_backward (&it, -dy);
3979 else if (dy > 0)
3980 move_it_to (&it, ZV, -1, it.current_y + dy, -1,
3981 MOVE_TO_POS | MOVE_TO_Y);
3974 } 3982 }
3975 else 3983 else
3976 move_it_by_lines (&it, n, 1); 3984 move_it_by_lines (&it, n, 1);
@@ -3985,9 +3993,8 @@ window_scroll_pixel_based (window, n, whole, noerror)
3985 > it.last_visible_y) 3993 > it.last_visible_y)
3986 /* The last line was only partially visible, make it fully 3994 /* The last line was only partially visible, make it fully
3987 visible. */ 3995 visible. */
3988 w->vscroll = 3996 w->vscroll = (it.last_visible_y
3989 it.last_visible_y 3997 - it.current_y + it.max_ascent + it.max_descent);
3990 - it.current_y + it.max_ascent + it.max_descent;
3991 else if (noerror) 3998 else if (noerror)
3992 return; 3999 return;
3993 else 4000 else