RCS file: /cvsroot/mc/mc/edit/editdraw.c,v
retrieving revision 1.42
diff -U2 -r1.42 editdraw.c
|
|
|
52 | 52 | #define MOD_MARKED (1 << 10) |
53 | 53 | #define MOD_CURSOR (1 << 11) |
| 54 | #define MOD_WHITESPACE (1 << 12) |
54 | 55 | |
55 | 56 | #define FONT_OFFSET_X 0 |
… |
… |
|
237 | 238 | } |
238 | 239 | |
239 | | if (style & MOD_BOLD) { |
240 | | set_color (EDITOR_BOLD_COLOR); |
241 | | } else if (style & MOD_MARKED) { |
242 | | set_color (EDITOR_MARKED_COLOR); |
| 240 | if (style & MOD_WHITESPACE) { |
| 241 | if (style & MOD_MARKED) { |
| 242 | textchar = ' '; |
| 243 | set_color (EDITOR_MARKED_COLOR); |
| 244 | } else { |
| 245 | #if 0 |
| 246 | if (color != EDITOR_NORMAL_COLOR) { |
| 247 | textchar = ' '; |
| 248 | lowlevel_set_color (color); |
| 249 | } else |
| 250 | #endif |
| 251 | set_color (EDITOR_WHITESPACE_COLOR); |
| 252 | } |
243 | 253 | } else { |
244 | | lowlevel_set_color (color); |
| 254 | if (style & MOD_BOLD) { |
| 255 | set_color (EDITOR_BOLD_COLOR); |
| 256 | } else if (style & MOD_MARKED) { |
| 257 | set_color (EDITOR_MARKED_COLOR); |
| 258 | } else { |
| 259 | lowlevel_set_color (color); |
| 260 | } |
245 | 261 | } |
246 | 262 | |
… |
… |
|
257 | 273 | static unsigned int line[MAX_LINE_LEN]; |
258 | 274 | unsigned int *p = line; |
259 | | long m1 = 0, m2 = 0, q, c1, c2; |
| 275 | long m1 = 0, m2 = 0, q, c1, c2, tws; |
260 | 276 | int col, start_col_real; |
261 | 277 | unsigned int c; |
… |
… |
|
280 | 296 | |
281 | 297 | if (row <= edit->total_lines - edit->start_line) { |
| 298 | if (use_colors) { |
| 299 | tws = edit_eol (edit, b); |
| 300 | while (tws > b && edit_get_byte (edit, tws - 1) == ' ') |
| 301 | tws--; |
| 302 | } |
| 303 | |
282 | 304 | while (col <= end_col - edit->start_col) { |
283 | 305 | *p = 0; |
… |
… |
|
306 | 328 | *p |= book_mark << 16; |
307 | 329 | } |
308 | | q++; |
309 | 330 | switch (c) { |
310 | 331 | case '\n': |
… |
… |
|
314 | 335 | case '\t': |
315 | 336 | i = TAB_SIZE - ((int) col % TAB_SIZE); |
316 | | *p |= ' '; |
317 | | c = *(p++) & ~MOD_CURSOR; |
318 | 337 | col += i; |
319 | | while (--i) |
320 | | *(p++) = c; |
| 338 | if (use_colors) { |
| 339 | c = (*p & ~MOD_CURSOR) | MOD_WHITESPACE; |
| 340 | if (i > 2) { |
| 341 | *(p++) |= '<' | MOD_WHITESPACE; |
| 342 | while (--i > 1) |
| 343 | *(p++) = c | '-'; |
| 344 | *(p++) = c | '>'; |
| 345 | } else if (i > 1) { |
| 346 | *(p++) |= '<' | MOD_WHITESPACE; |
| 347 | *(p++) = c | '>'; |
| 348 | } else |
| 349 | *(p++) |= '>' | MOD_WHITESPACE; |
| 350 | } else { |
| 351 | *p |= ' '; |
| 352 | c = *(p++) & ~MOD_CURSOR; |
| 353 | while (--i) |
| 354 | *(p++) = c; |
| 355 | } |
321 | 356 | break; |
| 357 | case ' ': |
| 358 | if (use_colors && q >= tws) { |
| 359 | *(p++) |= '.' | MOD_WHITESPACE; |
| 360 | col++; |
| 361 | break; |
| 362 | } |
| 363 | /* fallthrough */ |
322 | 364 | default: |
323 | 365 | c = convert_to_display_c (c); |
… |
… |
|
345 | 387 | break; |
346 | 388 | } |
| 389 | q++; |
347 | 390 | } |
348 | 391 | } |
RCS file: /cvsroot/mc/mc/src/color.c,v
retrieving revision 1.41
diff -U2 -r1.41 color.c
|
|
|
100 | 100 | { "editbold=", 0, 0 }, /* search->found */ |
101 | 101 | { "editmarked=", 0, 0 }, /* marked/selected */ |
| 102 | { "editwhitespace=", 0, 0 }, /* whitespace */ |
102 | 103 | |
103 | | /* error dialog colors start at 37 */ |
104 | | { "errdhotnormal=", 0, 0 }, /* Error dialog normal/hot */ /* 37 */ |
| 104 | /* error dialog colors start at 38 */ |
| 105 | { "errdhotnormal=", 0, 0 }, /* Error dialog normal/hot */ /* 38 */ |
105 | 106 | { "errdhotfocus=", 0, 0 }, /* Error dialog focused/hot */ |
106 | 107 | }; |
… |
… |
|
165 | 166 | "editbold=yellow,blue:" |
166 | 167 | "editmarked=black,cyan:" |
| 168 | "editwhitespace=brightblue,blue:" |
167 | 169 | "errdhotnormal=yellow,red:" |
168 | 170 | "errdhotfocus=yellow,lightgray"; |
RCS file: /cvsroot/mc/mc/src/color.h,v
retrieving revision 1.21
diff -U2 -r1.21 color.h
|
|
|
72 | 72 | |
73 | 73 | /* |
74 | | * editor colors - only 3 for normal, search->found, and select, respectively |
| 74 | * editor colors - only 4 for normal, search->found, select, and whitespace |
| 75 | * respectively |
75 | 76 | * Last is defined to view color. |
76 | 77 | */ |
… |
… |
|
79 | 80 | #define EDITOR_BOLD_COLOR IF_COLOR (35, A_BOLD) |
80 | 81 | #define EDITOR_MARKED_COLOR IF_COLOR (36, A_REVERSE) |
| 82 | #define EDITOR_WHITESPACE_COLOR IF_COLOR (37, 0 /* irrelevant */) |
81 | 83 | |
82 | 84 | /* Error dialog colors */ |
83 | | #define ERROR_HOT_NORMAL IF_COLOR (37, 0) |
84 | | #define ERROR_HOT_FOCUS IF_COLOR (38, 0) |
| 85 | #define ERROR_HOT_NORMAL IF_COLOR (38, 0) |
| 86 | #define ERROR_HOT_FOCUS IF_COLOR (39, 0) |
85 | 87 | |
86 | 88 | #ifdef HAVE_SLANG |