]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix display of overlay arrow immediately after invisible text
authorEli Zaretskii <eliz@gnu.org>
Sun, 30 Mar 2025 07:29:57 +0000 (10:29 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 31 Mar 2025 08:54:47 +0000 (10:54 +0200)
* src/xdisp.c (overlay_arrow_at_row): Allow the overlay arrow's
marker position to be anywhere between the row's start and end
charpos.  This keeps the overlay arrow on display even when the
preceding text is invisible.  (Bug#54843)

(cherry picked from commit 209b7e7444df5cb164679c0e55f46cba424ad13c)

src/xdisp.c

index fd997f443eacefb70c4b164d0a70393ace53753d..9f6754a98ca2e2f25b4f0a7a43cc9f1587e030fb 100644 (file)
@@ -16939,9 +16939,18 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row)
 
       val = find_symbol_value (var);
 
+      ptrdiff_t arrow_marker_pos;
       if (MARKERP (val)
          && current_buffer == XMARKER (val)->buffer
-         && (MATRIX_ROW_START_CHARPOS (row) == marker_position (val)))
+         && (arrow_marker_pos = marker_position (val),
+             /* Normally, the marker position will be at the row's
+                 start charpos.  But if the previous text lines are
+                 invisible, the row's start charpos includes those
+                 invisible lines, so we make a more general test that
+                 the marker position is anywhere between the start and
+                 the end character positions of this row.  */
+             (MATRIX_ROW_START_CHARPOS (row) <= arrow_marker_pos
+              && arrow_marker_pos < MATRIX_ROW_END_CHARPOS (row))))
        {
          if (FRAME_WINDOW_P (it->f)
              /* FIXME: if ROW->reversed_p is set, this should test