Changeset cb6c9e1
- Timestamp:
- Feb 26, 2011, 12:59:00 AM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- f54b07d
- Parents:
- 237d02c
- git-author:
- David Benjamin <davidben@mit.edu> (02/25/11 15:34:47)
- git-committer:
- David Benjamin <davidben@mit.edu> (02/26/11 00:59:00)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
r237d02c rcb6c9e1 131 131 static void _owl_fmtext_append_fmtext(owl_fmtext *f, const owl_fmtext *in, int start, int stop) 132 132 { 133 int a = 0, fg = 0, bg = 0;134 133 char attr = 0; 135 134 short fgcolor = OWL_COLOR_DEFAULT; … … 137 136 138 137 _owl_fmtext_scan_attributes(in, start, &attr, &fgcolor, &bgcolor); 139 if (attr != OWL_FMTEXT_ATTR_NONE) a=1; 140 if (fgcolor != OWL_COLOR_DEFAULT) fg=1; 141 if (bgcolor != OWL_COLOR_DEFAULT) bg=1; 142 143 if (a) 138 139 if (attr != OWL_FMTEXT_ATTR_NONE) 144 140 g_string_append_unichar(f->buff, OWL_FMTEXT_UC_ATTR | attr); 145 if (fg )141 if (fgcolor != OWL_COLOR_DEFAULT) 146 142 g_string_append_unichar(f->buff, OWL_FMTEXT_UC_FGCOLOR | fgcolor); 147 if (bg )143 if (bgcolor != OWL_COLOR_DEFAULT) 148 144 g_string_append_unichar(f->buff, OWL_FMTEXT_UC_BGCOLOR | bgcolor); 149 145 … … 264 260 p[0] = tmp; 265 261 266 /* Deal with new attributes. Initialize to defaults, then 267 process all consecutive formatting characters. */ 268 attr = default_attrs; 269 fg = default_fgcolor; 270 bg = default_bgcolor; 262 /* Deal with new attributes. Process all consecutive formatting 263 * characters, and then apply defaults where relevant. */ 271 264 while (owl_fmtext_is_format_char(g_utf8_get_char(p))) { 272 265 _owl_fmtext_update_attributes(g_utf8_get_char(p), &attr, &fg, &bg); 273 266 p = g_utf8_next_char(p); 274 267 } 275 _owl_fmtext_wattrset(w, attr | default_attrs);268 attr |= default_attrs; 276 269 if (fg == OWL_COLOR_DEFAULT) fg = default_fgcolor; 277 270 if (bg == OWL_COLOR_DEFAULT) bg = default_bgcolor; 271 _owl_fmtext_wattrset(w, attr); 278 272 _owl_fmtext_update_colorpair(fg, bg, &pair); 279 273 _owl_fmtext_wcolor_set(w, pair);
Note: See TracChangeset
for help on using the changeset viewer.