diff options
| author | Eli Zaretskii | 2019-04-24 15:26:54 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-04-24 15:26:54 +0300 |
| commit | f6e6c1744be5620ce97c8429a161ae5cf733a949 (patch) | |
| tree | 65bafac4721689f26ad9cec434e6f249f79219bf /src | |
| parent | a2e9d3e33508473547ffa7c3f800fe0e3c5b5c1c (diff) | |
| download | emacs-f6e6c1744be5620ce97c8429a161ae5cf733a949.tar.gz emacs-f6e6c1744be5620ce97c8429a161ae5cf733a949.zip | |
Fix posn-at-point with line-number display and display properties
* 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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index a88fc698b85..825b74d5392 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1623,6 +1623,12 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, | |||
| 1623 | set_iterator_to_next (&it3, false); | 1623 | set_iterator_to_next (&it3, false); |
| 1624 | } | 1624 | } |
| 1625 | top_x = it3.current_x - it3.pixel_width; | 1625 | top_x = it3.current_x - it3.pixel_width; |
| 1626 | /* Account for line-number display, if IT3 still | ||
| 1627 | didn't. This can happen if START - 1 is the | ||
| 1628 | first character on its display line. */ | ||
| 1629 | if (!it3.line_number_produced_p | ||
| 1630 | && it.line_number_produced_p) | ||
| 1631 | top_x += it.lnum_pixel_width; | ||
| 1626 | /* Normally, we would exit the above loop because we | 1632 | /* Normally, we would exit the above loop because we |
| 1627 | found the display element whose character | 1633 | found the display element whose character |
| 1628 | position is CHARPOS. For the contingency that we | 1634 | position is CHARPOS. For the contingency that we |