diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-08-07 01:54:06 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-08-07 01:54:06 +0000 |
commit | c6aecbbd026dbdf263b2da00b4f351556bbd8042 (patch) | |
tree | ed13571352b5bc77b85fafa10919ae083a610f6b /src/xdisp.c | |
parent | 709fc721684410ca0bf047846d4c3b657c541c8e (diff) | |
download | emacs-c6aecbbd026dbdf263b2da00b4f351556bbd8042.tar.gz |
(redisplay_window): Revert last change.
(try_window): Check bottom scroll margin too.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 4c099653a6d..920e7c1d34e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13668,11 +13668,6 @@ redisplay_window (window, just_this_one_p) debug_method_add (w, "same window start"); #endif - /* If there's a scroll margin, we must try to scroll, in case - point is now in the scroll margin. */ - if (scroll_margin > 0) - goto try_to_scroll; - /* Try to redisplay starting at same place as before. If point has not moved off frame, accept the results. */ if (!current_matrix_up_to_date_p @@ -14079,9 +14074,13 @@ try_window (window, pos, check_margins) { int this_scroll_margin; - this_scroll_margin = max (0, scroll_margin); - this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4); - this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); + if (scroll_margin > 0) + { + this_scroll_margin = min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4); + this_scroll_margin *= FRAME_LINE_HEIGHT (f); + } + else + this_scroll_margin = 0; if ((w->cursor.y >= 0 /* not vscrolled */ && w->cursor.y < this_scroll_margin @@ -14091,7 +14090,7 @@ try_window (window, pos, check_margins) seems to give wrong results. We don't want to recenter when the last line is partly visible, we want to allow that case to be handled in the usual way. */ - || (w->cursor.y + 1) > it.last_visible_y) + || w->cursor.y > it.last_visible_y - this_scroll_margin - 1) { w->cursor.vpos = -1; clear_glyph_matrix (w->desired_matrix); |