From: Eli Zaretskii Date: Sat, 5 Jul 2014 09:53:50 +0000 (+0300) Subject: Fix bug #17944 with pos-visible-in-window-p when there's image at window start. X-Git-Tag: emacs-24.3.93~91 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=546c26b394b5b9c14cfef71c36ba8d8f6af8217d;p=emacs.git Fix bug #17944 with pos-visible-in-window-p when there's image at window start. src/xdisp.c (pos_visible_p): Fix condition for finding CHARPOS by the first call to move_it_to. --- diff --git a/src/ChangeLog b/src/ChangeLog index a3210b557c7..89621bd54ec 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,6 +3,8 @@ * xdisp.c (pos_visible_p): If CHARPOS is at beginning of window, and there is a display property at that position, don't call move_it_to to move to a position before window start. (Bug#17942) + Fix condition for finding CHARPOS by the first call to move_it_to. + (Bug#17944) 2014-07-05 Stefan Monnier diff --git a/src/xdisp.c b/src/xdisp.c index f49710b21e5..913b57ed44b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1436,7 +1436,7 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y); if (charpos >= 0 - && (((!it.bidi_p || it.bidi_it.scan_dir == 1) + && (((!it.bidi_p || it.bidi_it.scan_dir != -1) && IT_CHARPOS (it) >= charpos) /* When scanning backwards under bidi iteration, move_it_to stops at or _before_ CHARPOS, because it stops at or to