Fix 'posn-at-point' around several 'display' properties

* src/xdisp.c (pos_visible_p): Fix the case when CHARPOS is hidden
by a display property, and its neighbors are also hidden.
(Bug#45915)
This commit is contained in:
Eli Zaretskii 2022-09-19 16:24:44 +03:00
parent c464bcb20a
commit cd2168cd13

View file

@ -1960,15 +1960,18 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
int top_x_before_string = it3.current_x;
/* Finally, advance the iterator until we hit the
first display element whose character position is
CHARPOS, or until the first newline from the
display string, which signals the end of the
display line. */
at or beyond CHARPOS, or until the first newline
from the display string, which signals the end of
the display line. */
while (get_next_display_element (&it3))
{
if (!EQ (it3.object, string))
top_x_before_string = it3.current_x;
PRODUCE_GLYPHS (&it3);
if (IT_CHARPOS (it3) == charpos
if ((it3.bidi_it.scan_dir == 1
&& IT_CHARPOS (it3) >= charpos)
|| (it3.bidi_it.scan_dir == -1
&& IT_CHARPOS (it3) <= charpos)
|| ITERATOR_AT_END_OF_LINE_P (&it3))
break;
it3_moved = true;