aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-10-31 13:32:29 +0000
committerGerd Moellmann2000-10-31 13:32:29 +0000
commit0a894bad85dd799d5c008fe21a7b4530f969029e (patch)
tree728d1cbce8484865baf1b8b7e165cb72313e255d /src
parente85ee976fe1a85fbd4adda3d6f168e0bf1c6cc16 (diff)
downloademacs-0a894bad85dd799d5c008fe21a7b4530f969029e.tar.gz
emacs-0a894bad85dd799d5c008fe21a7b4530f969029e.zip
(update_frame_line): Handle case where spaces in
the default face are colored.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/dispnew.c24
2 files changed, 19 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 023fa5eb891..d7ef66eb53c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12000-10-31 Gerd Moellmann <gerd@gnu.org> 12000-10-31 Gerd Moellmann <gerd@gnu.org>
2 2
3 * dispnew.c (update_frame_line): Handle case where spaces in
4 the default face are colored.
5
3 * xdisp.c (redisplay_tool_bar): Don't set fonts_changed_p if 6 * xdisp.c (redisplay_tool_bar): Don't set fonts_changed_p if
4 window height hasn't changed. 7 window height hasn't changed.
5 8
diff --git a/src/dispnew.c b/src/dispnew.c
index 14e4d968760..55faea7b7e3 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4997,7 +4997,7 @@ count_blanks (r, len)
4997 int len; 4997 int len;
4998{ 4998{
4999 int i; 4999 int i;
5000 5000
5001 for (i = 0; i < len; ++i) 5001 for (i = 0; i < len; ++i)
5002 if (!CHAR_GLYPH_SPACE_P (r[i])) 5002 if (!CHAR_GLYPH_SPACE_P (r[i]))
5003 break; 5003 break;
@@ -5047,6 +5047,12 @@ update_frame_line (frame, vpos)
5047 struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos); 5047 struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos);
5048 struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos); 5048 struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos);
5049 int must_write_whole_line_p; 5049 int must_write_whole_line_p;
5050 int write_spaces_p = must_write_spaces;
5051 int colored_spaces_p = (FACE_FROM_ID (frame, DEFAULT_FACE_ID)->background
5052 != FACE_TTY_DEFAULT_BG_COLOR);
5053
5054 if (colored_spaces_p)
5055 write_spaces_p = 1;
5050 5056
5051 if (desired_row->inverse_p 5057 if (desired_row->inverse_p
5052 != (current_row->enabled_p && current_row->inverse_p)) 5058 != (current_row->enabled_p && current_row->inverse_p))
@@ -5071,10 +5077,10 @@ update_frame_line (frame, vpos)
5071 obody = MATRIX_ROW_GLYPH_START (current_matrix, vpos); 5077 obody = MATRIX_ROW_GLYPH_START (current_matrix, vpos);
5072 olen = current_row->used[TEXT_AREA]; 5078 olen = current_row->used[TEXT_AREA];
5073 5079
5074 if (! current_row->inverse_p) 5080 if (!current_row->inverse_p)
5075 { 5081 {
5076 /* Ignore trailing spaces, if we can. */ 5082 /* Ignore trailing spaces, if we can. */
5077 if (!must_write_spaces) 5083 if (!write_spaces_p)
5078 while (olen > 0 && CHAR_GLYPH_SPACE_P (obody[olen-1])) 5084 while (olen > 0 && CHAR_GLYPH_SPACE_P (obody[olen-1]))
5079 olen--; 5085 olen--;
5080 } 5086 }
@@ -5107,7 +5113,7 @@ update_frame_line (frame, vpos)
5107 if (must_write_whole_line_p) 5113 if (must_write_whole_line_p)
5108 { 5114 {
5109 /* Ignore spaces at the end, if we can. */ 5115 /* Ignore spaces at the end, if we can. */
5110 if (!must_write_spaces) 5116 if (!write_spaces_p)
5111 while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1])) 5117 while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1]))
5112 --nlen; 5118 --nlen;
5113 5119
@@ -5139,7 +5145,7 @@ update_frame_line (frame, vpos)
5139 unless for one reason or another we must write all spaces. */ 5145 unless for one reason or another we must write all spaces. */
5140 if (!desired_row->inverse_p) 5146 if (!desired_row->inverse_p)
5141 { 5147 {
5142 if (!must_write_spaces) 5148 if (!write_spaces_p)
5143 while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1])) 5149 while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1]))
5144 nlen--; 5150 nlen--;
5145 } 5151 }
@@ -5199,7 +5205,7 @@ update_frame_line (frame, vpos)
5199 { 5205 {
5200 /* If current line is blank, skip over initial spaces, if 5206 /* If current line is blank, skip over initial spaces, if
5201 possible, and write the rest. */ 5207 possible, and write the rest. */
5202 if (must_write_spaces || desired_row->inverse_p) 5208 if (write_spaces_p || desired_row->inverse_p)
5203 nsp = 0; 5209 nsp = 0;
5204 else 5210 else
5205 nsp = count_blanks (nbody, nlen); 5211 nsp = count_blanks (nbody, nlen);
@@ -5217,7 +5223,9 @@ update_frame_line (frame, vpos)
5217 5223
5218 /* Compute number of leading blanks in old and new contents. */ 5224 /* Compute number of leading blanks in old and new contents. */
5219 osp = count_blanks (obody, olen); 5225 osp = count_blanks (obody, olen);
5220 nsp = desired_row->inverse_p ? 0 : count_blanks (nbody, nlen); 5226 nsp = (desired_row->inverse_p || colored_spaces_p
5227 ? 0
5228 : count_blanks (nbody, nlen));
5221 5229
5222 /* Compute number of matching chars starting with first non-blank. */ 5230 /* Compute number of matching chars starting with first non-blank. */
5223 begmatch = count_match (obody + osp, obody + olen, 5231 begmatch = count_match (obody + osp, obody + olen,
@@ -5225,7 +5233,7 @@ update_frame_line (frame, vpos)
5225 5233
5226 /* Spaces in new match implicit space past the end of old. */ 5234 /* Spaces in new match implicit space past the end of old. */
5227 /* A bug causing this to be a no-op was fixed in 18.29. */ 5235 /* A bug causing this to be a no-op was fixed in 18.29. */
5228 if (!must_write_spaces && osp + begmatch == olen) 5236 if (!write_spaces_p && osp + begmatch == olen)
5229 { 5237 {
5230 np1 = nbody + nsp; 5238 np1 = nbody + nsp;
5231 while (np1 + begmatch < nend && CHAR_GLYPH_SPACE_P (np1[begmatch])) 5239 while (np1 + begmatch < nend && CHAR_GLYPH_SPACE_P (np1[begmatch]))