]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix posn-at-point with line-number display and display properties
authorEli Zaretskii <eliz@gnu.org>
Wed, 24 Apr 2019 12:26:54 +0000 (15:26 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 24 Apr 2019 12:26:54 +0000 (15:26 +0300)
* src/xdisp.c (pos_visible_p): Account for line-number display
width when CHARPOS is covered by display property that begins
at the 2nd display element of a screen line.  (Bug#35404)

src/xdisp.c

index a88fc698b85825a0d0bc94f6d0198a5cd2107de0..825b74d5392237c3fde56712a0f857ba72bf5792 100644 (file)
@@ -1623,6 +1623,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y,
                      set_iterator_to_next (&it3, false);
                    }
                  top_x = it3.current_x - it3.pixel_width;
+                 /* Account for line-number display, if IT3 still
+                    didn't.  This can happen if START - 1 is the
+                    first character on its display line.  */
+                 if (!it3.line_number_produced_p
+                     && it.line_number_produced_p)
+                   top_x += it.lnum_pixel_width;
                  /* Normally, we would exit the above loop because we
                     found the display element whose character
                     position is CHARPOS.  For the contingency that we