diff options
| author | Gerd Moellmann | 2000-11-18 15:39:51 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-18 15:39:51 +0000 |
| commit | e47306e6461ea6b819f951f5e9d38d62be7f2c77 (patch) | |
| tree | 3cd8d95a7da6f34f69d1280d019b549437688321 /src | |
| parent | 509633e341042edf9290fd9705c27c35f1ce6aa9 (diff) | |
| download | emacs-e47306e6461ea6b819f951f5e9d38d62be7f2c77.tar.gz emacs-e47306e6461ea6b819f951f5e9d38d62be7f2c77.zip | |
(update_text_area): Don't skip over equal glyphs
when the last current glyph overlaps the glyph to its right.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/dispnew.c | 37 |
2 files changed, 34 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3677236528a..f7fef12be29 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2000-11-18 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * dispnew.c (update_text_area): Don't skip over equal glyphs | ||
| 4 | when the last current glyph overlaps the glyph to its right. | ||
| 5 | |||
| 1 | 2000-11-18 Miles Bader <miles@gnu.org> | 6 | 2000-11-18 Miles Bader <miles@gnu.org> |
| 2 | 7 | ||
| 3 | * xdisp.c (message_log_check_duplicate): Let "..."-detection match | 8 | * xdisp.c (message_log_check_duplicate): Let "..."-detection match |
diff --git a/src/dispnew.c b/src/dispnew.c index eff7bb2bf15..8e8f6c5b437 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Updating of data structures for redisplay. | 1 | /* Updating of data structures for redisplay. |
| 2 | Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 97, 98, 1999 | 2 | Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 97, 98, 1999, 2000 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -3981,6 +3981,7 @@ update_text_area (w, vpos) | |||
| 3981 | int stop, i, x; | 3981 | int stop, i, x; |
| 3982 | struct glyph *current_glyph = current_row->glyphs[TEXT_AREA]; | 3982 | struct glyph *current_glyph = current_row->glyphs[TEXT_AREA]; |
| 3983 | struct glyph *desired_glyph = desired_row->glyphs[TEXT_AREA]; | 3983 | struct glyph *desired_glyph = desired_row->glyphs[TEXT_AREA]; |
| 3984 | int overlapping_glyphs_p = current_row->contains_overlapping_glyphs_p; | ||
| 3984 | 3985 | ||
| 3985 | /* If the desired row extends its face to the text area end, | 3986 | /* If the desired row extends its face to the text area end, |
| 3986 | make sure we write at least one glyph, so that the face | 3987 | make sure we write at least one glyph, so that the face |
| @@ -3995,15 +3996,34 @@ update_text_area (w, vpos) | |||
| 3995 | 3996 | ||
| 3996 | while (i < stop) | 3997 | while (i < stop) |
| 3997 | { | 3998 | { |
| 3999 | int skip_equal_glyphs_p = 1; | ||
| 4000 | |||
| 3998 | /* Skip over glyphs that both rows have in common. These | 4001 | /* Skip over glyphs that both rows have in common. These |
| 3999 | don't have to be written. */ | 4002 | don't have to be written. We can't skip if the last |
| 4000 | while (i < stop | 4003 | current glyph overlaps the glyph to its right. For |
| 4001 | && GLYPH_EQUAL_P (desired_glyph, current_glyph)) | 4004 | example, consider a current row of `if ' with the `f' in |
| 4005 | Courier bold so that it overlaps the ` ' to its right. | ||
| 4006 | If the desired row is ` ', we would skip over the space | ||
| 4007 | after the `if' and there would remain a pixel from the | ||
| 4008 | `f' on the screen. */ | ||
| 4009 | if (overlapping_glyphs_p && i > 0) | ||
| 4002 | { | 4010 | { |
| 4003 | x += desired_glyph->pixel_width; | 4011 | struct glyph *glyph = ¤t_row->glyphs[TEXT_AREA][i - 1]; |
| 4004 | ++desired_glyph, ++current_glyph, ++i; | 4012 | int left, right; |
| 4013 | |||
| 4014 | rif->get_glyph_overhangs (glyph, XFRAME (w->frame), | ||
| 4015 | &left, &right); | ||
| 4016 | skip_equal_glyphs_p = right == 0; | ||
| 4005 | } | 4017 | } |
| 4006 | 4018 | ||
| 4019 | if (skip_equal_glyphs_p) | ||
| 4020 | while (i < stop | ||
| 4021 | && GLYPH_EQUAL_P (desired_glyph, current_glyph)) | ||
| 4022 | { | ||
| 4023 | x += desired_glyph->pixel_width; | ||
| 4024 | ++desired_glyph, ++current_glyph, ++i; | ||
| 4025 | } | ||
| 4026 | |||
| 4007 | /* Consider the case that the current row contains "xxx ppp | 4027 | /* Consider the case that the current row contains "xxx ppp |
| 4008 | ggg" in italic Courier font, and the desired row is "xxx | 4028 | ggg" in italic Courier font, and the desired row is "xxx |
| 4009 | ggg". The character `p' has lbearing, `g' has not. The | 4029 | ggg". The character `p' has lbearing, `g' has not. The |
| @@ -4011,12 +4031,13 @@ update_text_area (w, vpos) | |||
| 4011 | current row. If we would start writing glyphs there, we | 4031 | current row. If we would start writing glyphs there, we |
| 4012 | wouldn't erase the lbearing of the `p'. The rest of the | 4032 | wouldn't erase the lbearing of the `p'. The rest of the |
| 4013 | lbearing problem is then taken care of by x_draw_glyphs. */ | 4033 | lbearing problem is then taken care of by x_draw_glyphs. */ |
| 4014 | if (current_row->contains_overlapping_glyphs_p | 4034 | if (overlapping_glyphs_p |
| 4015 | && i > 0 | 4035 | && i > 0 |
| 4016 | && i < current_row->used[TEXT_AREA] | 4036 | && i < current_row->used[TEXT_AREA] |
| 4017 | && current_row->used[TEXT_AREA] != desired_row->used[TEXT_AREA]) | 4037 | && current_row->used[TEXT_AREA] != desired_row->used[TEXT_AREA]) |
| 4018 | { | 4038 | { |
| 4019 | int left, right; | 4039 | int left, right; |
| 4040 | |||
| 4020 | rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame), | 4041 | rif->get_glyph_overhangs (current_glyph, XFRAME (w->frame), |
| 4021 | &left, &right); | 4042 | &left, &right); |
| 4022 | while (left > 0 && i > 0) | 4043 | while (left > 0 && i > 0) |
| @@ -4054,7 +4075,7 @@ update_text_area (w, vpos) | |||
| 4054 | desired_glyph = start; | 4075 | desired_glyph = start; |
| 4055 | break; | 4076 | break; |
| 4056 | } | 4077 | } |
| 4057 | 4078 | ||
| 4058 | rif->cursor_to (vpos, start_hpos, desired_row->y, start_x); | 4079 | rif->cursor_to (vpos, start_hpos, desired_row->y, start_x); |
| 4059 | rif->write_glyphs (start, i - start_hpos); | 4080 | rif->write_glyphs (start, i - start_hpos); |
| 4060 | changed_p = 1; | 4081 | changed_p = 1; |