Commit f0ee99a0 authored by Eli Zaretskii's avatar Eli Zaretskii

Avoid assertion violation when scrolling minibuffer windows.

 src/xdisp.c (pos_visible_p): If the window start position is beyond
 ZV, start the display from buffer beginning.  Prevents assertion
 violation in init_iterator when the minibuffer window is scrolled
 via the scroll bar.
 src/window.c (window_scroll_pixel_based): Likewise.
parent 775ab395
2012-04-23 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (pos_visible_p): If the window start position is beyond
ZV, start the display from buffer beginning. Prevents assertion
violation in init_iterator when the minibuffer window is scrolled
via the scroll bar.
* window.c (window_scroll_pixel_based): Likewise.
2012-04-23 Chong Yidong <cyd@gnu.org>
* keymap.c (where_is_internal): Doc fix (Bug#10872).
......
......@@ -4221,6 +4221,11 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
void *itdata = NULL;
SET_TEXT_POS_FROM_MARKER (start, w->start);
/* Scrolling a minibuffer window via scroll bar when the echo area
shows long text sometimes resets the minibuffer contents behind
our backs. */
if (CHARPOS (start) > ZV)
SET_TEXT_POS (start, BEGV, BEGV_BYTE);
/* If PT is not visible in WINDOW, move back one half of
the screen. Allow PT to be partially visible, otherwise
......
......@@ -1265,6 +1265,11 @@ pos_visible_p (struct window *w, EMACS_INT charpos, int *x, int *y,
}
SET_TEXT_POS_FROM_MARKER (top, w->start);
/* Scrolling a minibuffer window via scroll bar when the echo area
shows long text sometimes resets the minibuffer contents behind
our backs. */
if (CHARPOS (top) > ZV)
SET_TEXT_POS (top, BEGV, BEGV_BYTE);
/* Compute exact mode line heights. */
if (WINDOW_WANTS_MODELINE_P (w))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment