diff options
author | Eli Zaretskii <eliz@gnu.org> | 2014-02-19 19:32:29 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2014-02-19 19:32:29 +0200 |
commit | d34f67dae3caa277bfebe0aa9f60e83a22bce0eb (patch) | |
tree | 60aaa93a0d278989576ce05f61167cc4467ca139 /src/xdisp.c | |
parent | c021382022a9b5d1e61415f219eaa2b31a8c1a29 (diff) | |
download | emacs-d34f67dae3caa277bfebe0aa9f60e83a22bce0eb.tar.gz |
Fix bug #16806 with horizontal scrolling of images when fringes are disabled.
src/xdisp.c (display_line): Fix horizontal scrolling of large images
when fringes are turned off. This comes at a price of not
displaying the truncation/continuation glyphs in this case.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index d941c7b1086..b9908c6c9c6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20119,7 +20119,12 @@ display_line (struct it *it) /* If we truncate lines, we are done when the last displayed glyphs reach past the right margin of the window. */ if (it->line_wrap == TRUNCATE - && (FRAME_WINDOW_P (it->f) && WINDOW_RIGHT_FRINGE_WIDTH (it->w) + && ((FRAME_WINDOW_P (it->f) + /* Images are preprocessed in produce_image_glyph such + that they are cropped at the right edge of the + window, so an image glyph will always end exactly at + last_visible_x, even if there's no right fringe. */ + && (WINDOW_RIGHT_FRINGE_WIDTH (it->w) || it->what == IT_IMAGE)) ? (it->current_x >= it->last_visible_x) : (it->current_x > it->last_visible_x))) { @@ -20152,19 +20157,26 @@ display_line (struct it *it) i = row->used[TEXT_AREA] - (i + 1); } - it->current_x = x_before; - if (!FRAME_WINDOW_P (it->f)) + /* produce_special_glyphs overwrites the last glyph, so + we don't want that if we want to keep that last + glyph, which means it's an image. */ + if (it->current_x > it->last_visible_x) { - for (n = row->used[TEXT_AREA]; i < n; ++i) + it->current_x = x_before; + if (!FRAME_WINDOW_P (it->f)) + { + for (n = row->used[TEXT_AREA]; i < n; ++i) + { + row->used[TEXT_AREA] = i; + produce_special_glyphs (it, IT_TRUNCATION); + } + } + else { row->used[TEXT_AREA] = i; produce_special_glyphs (it, IT_TRUNCATION); } - } - else - { - row->used[TEXT_AREA] = i; - produce_special_glyphs (it, IT_TRUNCATION); + it->hpos = hpos_before; } } else if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) @@ -20183,13 +20195,13 @@ display_line (struct it *it) goto at_end_of_line; } it->current_x = x_before; + it->hpos = hpos_before; } row->truncated_on_right_p = 1; it->continuation_lines_width = 0; reseat_at_next_visible_line_start (it, 0); row->ends_at_zv_p = FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n'; - it->hpos = hpos_before; break; } } @@ -20203,9 +20215,12 @@ display_line (struct it *it) && IT_CHARPOS (*it) != CHARPOS (row->start.pos)) { if (!FRAME_WINDOW_P (it->f) - || (row->reversed_p - ? WINDOW_RIGHT_FRINGE_WIDTH (it->w) - : WINDOW_LEFT_FRINGE_WIDTH (it->w)) == 0) + || (((row->reversed_p + ? WINDOW_RIGHT_FRINGE_WIDTH (it->w) + : WINDOW_LEFT_FRINGE_WIDTH (it->w)) == 0) + /* Don't let insert_left_trunc_glyphs overwrite the + first glyph of the row if it is an image. */ + && row->glyphs[TEXT_AREA]->type != IMAGE_GLYPH)) insert_left_trunc_glyphs (it); row->truncated_on_left_p = 1; } |