diff options
author | Eli Zaretskii <eliz@gnu.org> | 2011-11-25 17:22:30 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2011-11-25 17:22:30 +0200 |
commit | 5c730f48c59db8a891cbe46014645f01b4c201e6 (patch) | |
tree | 29c9ed06673f2ae7b23050217083c1e77aed29e7 | |
parent | 94af99a4bf6af2c9e19b4290756f695f120b508f (diff) | |
download | emacs-5c730f48c59db8a891cbe46014645f01b4c201e6.tar.gz |
Fix a thinko in 2011-11-25T11:32:14Z!eliz@gnu.org.
-rw-r--r-- | src/xdisp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 953a102b095..9397d15acb7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15043,7 +15043,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p) int centering_position = -1; int last_line_misfit = 0; EMACS_INT beg_unchanged, end_unchanged; - int scrolling_up; SET_TEXT_POS (lpoint, PT, PT_BYTE); opoint = lpoint; @@ -15559,6 +15558,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) : 0; EMACS_INT margin_pos = CHARPOS (startp); Lisp_Object aggressive; + int scrolling_up; /* If there is a scroll margin at the top of the window, find its character position. */ @@ -15730,8 +15730,9 @@ redisplay_window (Lisp_Object window, int just_this_one_p) scroll_margin > 0 ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4) : 0; + int move_down = w->cursor.vpos >= WINDOW_TOTAL_LINES (w) / 2; - move_it_by_lines (&it, scrolling_up ? margin + 1 : margin -1); + move_it_by_lines (&it, move_down ? margin + 1 : -(margin + 1)); clear_glyph_matrix (w->desired_matrix); if (1 == try_window (window, it.current.pos, TRY_WINDOW_CHECK_MARGINS)) |