aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.c5
-rw-r--r--src/xdisp.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c
index 374ef0f838f..753ebc16fbf 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4813,8 +4813,9 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
4813 SET_TEXT_POS_FROM_MARKER (start, w->start); 4813 SET_TEXT_POS_FROM_MARKER (start, w->start);
4814 /* Scrolling a minibuffer window via scroll bar when the echo area 4814 /* Scrolling a minibuffer window via scroll bar when the echo area
4815 shows long text sometimes resets the minibuffer contents behind 4815 shows long text sometimes resets the minibuffer contents behind
4816 our backs. */ 4816 our backs. Also, someone might narrow-to-region and immediately
4817 if (CHARPOS (start) > ZV) 4817 call a scroll function. */
4818 if (CHARPOS (start) > ZV || CHARPOS (start) < BEGV)
4818 SET_TEXT_POS (start, BEGV, BEGV_BYTE); 4819 SET_TEXT_POS (start, BEGV, BEGV_BYTE);
4819 4820
4820 /* If PT is not visible in WINDOW, move back one half of 4821 /* If PT is not visible in WINDOW, move back one half of
diff --git a/src/xdisp.c b/src/xdisp.c
index dc68cd48e5f..d1e884820b6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1317,8 +1317,9 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
1317 SET_TEXT_POS_FROM_MARKER (top, w->start); 1317 SET_TEXT_POS_FROM_MARKER (top, w->start);
1318 /* Scrolling a minibuffer window via scroll bar when the echo area 1318 /* Scrolling a minibuffer window via scroll bar when the echo area
1319 shows long text sometimes resets the minibuffer contents behind 1319 shows long text sometimes resets the minibuffer contents behind
1320 our backs. */ 1320 our backs. Also, someone might narrow-to-region and immediately
1321 if (CHARPOS (top) > ZV) 1321 call a scroll function. */
1322 if (CHARPOS (top) > ZV || CHARPOS (top) < BEGV)
1322 SET_TEXT_POS (top, BEGV, BEGV_BYTE); 1323 SET_TEXT_POS (top, BEGV, BEGV_BYTE);
1323 1324
1324 /* If the top of the window is after CHARPOS, the latter is surely 1325 /* If the top of the window is after CHARPOS, the latter is surely