diff options
| author | Kenichi Handa | 2001-01-15 04:32:52 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2001-01-15 04:32:52 +0000 |
| commit | 37be86f28f3ef37de6e37f2e9c336612633c1c76 (patch) | |
| tree | f9d61e6a9a75972594c92a8d96639319e694a2c9 /src | |
| parent | ebeccffa9e716ca0c3ddbb7b96486019d337e571 (diff) | |
| download | emacs-37be86f28f3ef37de6e37f2e9c336612633c1c76.tar.gz emacs-37be86f28f3ef37de6e37f2e9c336612633c1c76.zip | |
(insert_left_trunc_glyphs): Overwrite padding glyphs by
truncation glyphs.
(display_line): Optimize for wide characters.
(display_string): Don't try to display a multi-column charaters
partially. On ttys, produce more than one truncation glyph for
multi-column characters that don't fit on the line.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 4a3abe5bc13..a2496dd2dbb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -11695,14 +11695,16 @@ insert_left_trunc_glyphs (it) | |||
| 11695 | while (from < end) | 11695 | while (from < end) |
| 11696 | *to++ = *from++; | 11696 | *to++ = *from++; |
| 11697 | 11697 | ||
| 11698 | /* There may be padding glyphs left over. Remove them. */ | 11698 | /* There may be padding glyphs left over. Overwrite them too. */ |
| 11699 | from = to; | 11699 | while (to < toend && CHAR_GLYPH_PADDING_P (*to)) |
| 11700 | while (from < toend && CHAR_GLYPH_PADDING_P (*from)) | 11700 | { |
| 11701 | ++from; | 11701 | from = truncate_it.glyph_row->glyphs[TEXT_AREA]; |
| 11702 | while (from < toend) | 11702 | while (from < end) |
| 11703 | *to++ = *from++; | 11703 | *to++ = *from++; |
| 11704 | } | ||
| 11704 | 11705 | ||
| 11705 | it->glyph_row->used[TEXT_AREA] = to - it->glyph_row->glyphs[TEXT_AREA]; | 11706 | if (to > toend) |
| 11707 | it->glyph_row->used[TEXT_AREA] = to - it->glyph_row->glyphs[TEXT_AREA]; | ||
| 11706 | } | 11708 | } |
| 11707 | 11709 | ||
| 11708 | 11710 | ||
| @@ -12188,10 +12190,13 @@ display_line (it) | |||
| 12188 | hpos_before = it->hpos; | 12190 | hpos_before = it->hpos; |
| 12189 | x_before = x; | 12191 | x_before = x; |
| 12190 | 12192 | ||
| 12191 | if (nglyphs == 1 | 12193 | if ((nglyphs == 1 |
| 12194 | /* A wide multibyte character produces multiple glyphs on | ||
| 12195 | tty window .*/ | ||
| 12196 | || !SINGLE_BYTE_CHAR_P (it->c)) | ||
| 12192 | && it->current_x < it->last_visible_x) | 12197 | && it->current_x < it->last_visible_x) |
| 12193 | { | 12198 | { |
| 12194 | ++it->hpos; | 12199 | it->hpos += nglyphs; |
| 12195 | row->ascent = max (row->ascent, it->max_ascent); | 12200 | row->ascent = max (row->ascent, it->max_ascent); |
| 12196 | row->height = max (row->height, it->max_ascent + it->max_descent); | 12201 | row->height = max (row->height, it->max_ascent + it->max_descent); |
| 12197 | row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); | 12202 | row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
| @@ -13715,8 +13720,17 @@ display_string (string, lisp_string, face_string, face_string_pos, | |||
| 13715 | && x + glyph->pixel_width > max_x) | 13720 | && x + glyph->pixel_width > max_x) |
| 13716 | { | 13721 | { |
| 13717 | /* End of continued line or max_x reached. */ | 13722 | /* End of continued line or max_x reached. */ |
| 13718 | it->glyph_row->used[TEXT_AREA] = n_glyphs_before + i; | 13723 | if (CHAR_GLYPH_PADDING_P (*glyph)) |
| 13719 | it->current_x = x; | 13724 | { |
| 13725 | /* A wide character is unbreakable. */ | ||
| 13726 | it->glyph_row->used[TEXT_AREA] = n_glyphs_before; | ||
| 13727 | it->current_x = x_before; | ||
| 13728 | } | ||
| 13729 | else | ||
| 13730 | { | ||
| 13731 | it->glyph_row->used[TEXT_AREA] = n_glyphs_before + i; | ||
| 13732 | it->current_x = x; | ||
| 13733 | } | ||
| 13720 | break; | 13734 | break; |
| 13721 | } | 13735 | } |
| 13722 | else if (x + glyph->pixel_width > it->first_visible_x) | 13736 | else if (x + glyph->pixel_width > it->first_visible_x) |
| @@ -13764,7 +13778,18 @@ display_string (string, lisp_string, face_string, face_string_pos, | |||
| 13764 | if (IT_CHARPOS (*it) < it->string_nchars) | 13778 | if (IT_CHARPOS (*it) < it->string_nchars) |
| 13765 | { | 13779 | { |
| 13766 | if (!FRAME_WINDOW_P (it->f)) | 13780 | if (!FRAME_WINDOW_P (it->f)) |
| 13767 | produce_special_glyphs (it, IT_TRUNCATION); | 13781 | { |
| 13782 | int i, n; | ||
| 13783 | |||
| 13784 | for (i = row->used[TEXT_AREA] - 1; i > 0; --i) | ||
| 13785 | if (!CHAR_GLYPH_PADDING_P (row->glyphs[TEXT_AREA][i])) | ||
| 13786 | break; | ||
| 13787 | for (n = row->used[TEXT_AREA]; i < n; ++i) | ||
| 13788 | { | ||
| 13789 | row->used[TEXT_AREA] = i; | ||
| 13790 | produce_special_glyphs (it, IT_TRUNCATION); | ||
| 13791 | } | ||
| 13792 | } | ||
| 13768 | it->glyph_row->truncated_on_right_p = 1; | 13793 | it->glyph_row->truncated_on_right_p = 1; |
| 13769 | } | 13794 | } |
| 13770 | break; | 13795 | break; |