[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master cd2168cd13: Fix 'posn-at-point' around several 'display' properti
From: |
Eli Zaretskii |
Subject: |
master cd2168cd13: Fix 'posn-at-point' around several 'display' properties |
Date: |
Mon, 19 Sep 2022 09:25:53 -0400 (EDT) |
branch: master
commit cd2168cd131852279a7d9257c7dff45224c9d6a9
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
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)
---
src/xdisp.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index 80a0763695..ee074c018e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master cd2168cd13: Fix 'posn-at-point' around several 'display' properties,
Eli Zaretskii <=