aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2025-03-26 19:04:16 +0200
committerEli Zaretskii2025-03-26 19:04:16 +0200
commit1e68351d56918cd4d7883bcff629f794660a3134 (patch)
tree8fd10c7b35a8918ac06298d444b2409728d4172e /src
parent8f7790a95ecd88efec97417f1a3b51ba9da5e287 (diff)
downloademacs-1e68351d56918cd4d7883bcff629f794660a3134.tar.gz
emacs-1e68351d56918cd4d7883bcff629f794660a3134.zip
Fix vertical cursor motion with wide images and line numbers
* src/xdisp.c (produce_image_glyph): When cropping an image that exceeds the window's right edge, account for the screen estate taken by line-number display. (Bug#77217)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 4e8bb7d9b97..f2b158f00e3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -31956,12 +31956,14 @@ produce_image_glyph (struct it *it)
31956 word-wrap, unless the image starts at column zero, because 31956 word-wrap, unless the image starts at column zero, because
31957 wrapping correctly needs the real pixel width of the image. */ 31957 wrapping correctly needs the real pixel width of the image. */
31958 if ((it->line_wrap != WORD_WRAP 31958 if ((it->line_wrap != WORD_WRAP
31959 || it->hpos == 0 31959 || it->hpos == (0 + (it->lnum_width ? it->lnum_width + 2 : 0))
31960 /* Always crop images larger than the window-width, minus 1 space. */ 31960 /* Always crop images larger than the window-width, minus 1 space. */
31961 || it->pixel_width > it->last_visible_x - FRAME_COLUMN_WIDTH (it->f)) 31961 || it->pixel_width > (it->last_visible_x - it->lnum_pixel_width
31962 - FRAME_COLUMN_WIDTH (it->f)))
31962 && (crop = it->pixel_width - (it->last_visible_x - it->current_x), 31963 && (crop = it->pixel_width - (it->last_visible_x - it->current_x),
31963 crop > 0) 31964 crop > 0)
31964 && (it->hpos == 0 || it->pixel_width > it->last_visible_x / 4)) 31965 && (it->hpos == (0 + (it->lnum_width ? it->lnum_width + 2 : 0))
31966 || it->pixel_width > it->last_visible_x / 4))
31965 { 31967 {
31966 it->pixel_width -= crop; 31968 it->pixel_width -= crop;
31967 slice.width -= crop; 31969 slice.width -= crop;