aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2017-09-09 17:20:47 +0300
committerEli Zaretskii2017-09-09 17:20:47 +0300
commitd1da8e534db54bb82b6f2b16bba86a6d202ac675 (patch)
treecbfe991cd0d77833a3a2a6b96eeefc34412adfce /src
parentaf11532bb5f5ff8229b84c3ab6888069764bbddf (diff)
downloademacs-d1da8e534db54bb82b6f2b16bba86a6d202ac675.tar.gz
emacs-d1da8e534db54bb82b6f2b16bba86a6d202ac675.zip
Avoid infloop when scrolling under scroll-preserve-screen-position
* src/window.c (window_scroll_pixel_based): If screen position is to be preserved, make sure its recorded Y coordinate is outside the scroll margin. (Bug#28342)
Diffstat (limited to 'src')
-rw-r--r--src/window.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c
index 857870591f3..18adb62538b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5335,6 +5335,11 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5335 break; 5335 break;
5336 } 5336 }
5337 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 5337 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
5338 /* Fix up the Y position to preserve, if it is inside the
5339 scroll margin at the window top. */
5340 if (window_scroll_pixel_based_preserve_y >= 0
5341 && window_scroll_pixel_based_preserve_y < this_scroll_margin)
5342 window_scroll_pixel_based_preserve_y = this_scroll_margin;
5338 } 5343 }
5339 } 5344 }
5340 else if (n < 0) 5345 else if (n < 0)