aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2017-12-29 23:41:20 +0200
committerEli Zaretskii2017-12-29 23:41:20 +0200
commit0c78822c701533a94b010a043bcb049dd594bb93 (patch)
treec789e5e604a42b12537c60e42017ef6a8cee8795 /src
parentacd289c5a4d9679ec8051b330e7a8685d4fde20f (diff)
downloademacs-0c78822c701533a94b010a043bcb049dd594bb93.tar.gz
emacs-0c78822c701533a94b010a043bcb049dd594bb93.zip
Fix subtle problem with scroll-down when scroll-margin is nonzero
* src/window.c (window_scroll_pixel_based): Account for scroll-margin when scrolling down, i.e. moving window-start towards the beginning of the buffer. Reported by zhang cc <ccsmile2008@outlook.com> in http://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00894.html.
Diffstat (limited to 'src')
-rw-r--r--src/window.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index 504dcd38357..20a6020a3b7 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5397,12 +5397,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5397 if (it.what == IT_EOB) 5397 if (it.what == IT_EOB)
5398 partial_p = 5398 partial_p =
5399 it.current_y + it.ascent + it.descent 5399 it.current_y + it.ascent + it.descent
5400 > it.last_visible_y - WINDOW_HEADER_LINE_HEIGHT (w); 5400 > it.last_visible_y - this_scroll_margin - WINDOW_HEADER_LINE_HEIGHT (w);
5401 else 5401 else
5402 { 5402 {
5403 move_it_by_lines (&it, 1); 5403 move_it_by_lines (&it, 1);
5404 partial_p = 5404 partial_p =
5405 it.current_y > it.last_visible_y - WINDOW_HEADER_LINE_HEIGHT (w); 5405 it.current_y
5406 > it.last_visible_y - this_scroll_margin - WINDOW_HEADER_LINE_HEIGHT (w);
5406 } 5407 }
5407 5408
5408 if (charpos == PT && !partial_p 5409 if (charpos == PT && !partial_p