diff options
author | Eli Zaretskii <eliz@gnu.org> | 2023-12-04 15:10:06 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2023-12-04 15:10:06 +0200 |
commit | 7a7d41e07c4627c5de08a66368309b478c88edfc (patch) | |
tree | 058ac552fe4e804f5ad9de7401ddc0abc6035bf7 /src/xdisp.c | |
parent | cf11fdfd8e460d966ba279f00633ab378038de68 (diff) | |
download | emacs-7a7d41e07c4627c5de08a66368309b478c88edfc.tar.gz |
Avoid infloop with wide images
* src/xdisp.c (produce_image_glyph): Avoid inflooping under
visual-line-mode when wide images are displayed. (Bug#67533)
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index ca8583869df..75d769600c4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -31364,7 +31364,10 @@ produce_image_glyph (struct it *it) the cursor on same display row. But don't do that under word-wrap, unless the image starts at column zero, because wrapping correctly needs the real pixel width of the image. */ - if ((it->line_wrap != WORD_WRAP || it->hpos == 0) + if ((it->line_wrap != WORD_WRAP + || it->hpos == 0 + /* Always crop images larger than the window-width, minus 1 space. */ + || it->pixel_width > it->last_visible_x - FRAME_COLUMN_WIDTH (it->f)) && (crop = it->pixel_width - (it->last_visible_x - it->current_x), crop > 0) && (it->hpos == 0 || it->pixel_width > it->last_visible_x / 4)) |