RCS file: /sources/mc/mc/edit/editdraw.c,v
retrieving revision 1.46
diff -U2 -r1.46 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 |
… |
… |
|
244 | 245 | } |
245 | 246 | |
246 | | if (style & MOD_BOLD) { |
247 | | set_color (EDITOR_BOLD_COLOR); |
248 | | } else if (style & MOD_MARKED) { |
249 | | set_color (EDITOR_MARKED_COLOR); |
| 247 | if (style & MOD_WHITESPACE) { |
| 248 | if (style & MOD_MARKED) { |
| 249 | textchar = ' '; |
| 250 | set_color (EDITOR_MARKED_COLOR); |
| 251 | } else { |
| 252 | #if 0 |
| 253 | if (color != EDITOR_NORMAL_COLOR) { |
| 254 | textchar = ' '; |
| 255 | lowlevel_set_color (color); |
| 256 | } else |
| 257 | #endif |
| 258 | set_color (EDITOR_WHITESPACE_COLOR); |
| 259 | } |
250 | 260 | } else { |
251 | | lowlevel_set_color (color); |
| 261 | if (style & MOD_BOLD) { |
| 262 | set_color (EDITOR_BOLD_COLOR); |
| 263 | } else if (style & MOD_MARKED) { |
| 264 | set_color (EDITOR_MARKED_COLOR); |
| 265 | } else { |
| 266 | lowlevel_set_color (color); |
| 267 | } |
252 | 268 | } |
253 | 269 | |
… |
… |
|
257 | 273 | } |
258 | 274 | |
| 275 | int visible_tabs = 1, visible_tws = 1; |
| 276 | |
259 | 277 | /* b is a pointer to the beginning of the line */ |
260 | 278 | static void |
… |
… |
|
264 | 282 | static unsigned int line[MAX_LINE_LEN]; |
265 | 283 | unsigned int *p = line; |
266 | | long m1 = 0, m2 = 0, q, c1, c2; |
| 284 | long m1 = 0, m2 = 0, q, c1, c2, tws; |
267 | 285 | int col, start_col_real; |
268 | 286 | unsigned int c; |
… |
… |
|
287 | 305 | |
288 | 306 | if (row <= edit->total_lines - edit->start_line) { |
| 307 | if (use_colors && visible_tws) { |
| 308 | tws = edit_eol (edit, b); |
| 309 | while (tws > b && ((c = edit_get_byte (edit, tws - 1)) == ' ' |
| 310 | || c == '\t')) |
| 311 | tws--; |
| 312 | } |
| 313 | |
289 | 314 | while (col <= end_col - edit->start_col) { |
290 | 315 | *p = 0; |
… |
… |
|
313 | 338 | *p |= book_mark << 16; |
314 | 339 | } |
315 | | q++; |
316 | 340 | switch (c) { |
317 | 341 | case '\n': |
… |
… |
|
321 | 345 | case '\t': |
322 | 346 | i = TAB_SIZE - ((int) col % TAB_SIZE); |
323 | | *p |= ' '; |
324 | | c = *(p++) & ~MOD_CURSOR; |
325 | 347 | col += i; |
326 | | while (--i) |
327 | | *(p++) = c; |
| 348 | if (use_colors && visible_tabs) { |
| 349 | c = (*p & ~MOD_CURSOR) | MOD_WHITESPACE; |
| 350 | if (i > 2) { |
| 351 | *(p++) |= '<' | MOD_WHITESPACE; |
| 352 | while (--i > 1) |
| 353 | *(p++) = c | '-'; |
| 354 | *(p++) = c | '>'; |
| 355 | } else if (i > 1) { |
| 356 | *(p++) |= '<' | MOD_WHITESPACE; |
| 357 | *(p++) = c | '>'; |
| 358 | } else |
| 359 | *(p++) |= '>' | MOD_WHITESPACE; |
| 360 | } else if (use_colors && visible_tws && q >= tws) { |
| 361 | *p |= '.' | MOD_WHITESPACE; |
| 362 | c = *(p++) & ~MOD_CURSOR; |
| 363 | while (--i) |
| 364 | *(p++) = c; |
| 365 | } else { |
| 366 | *p |= ' '; |
| 367 | c = *(p++) & ~MOD_CURSOR; |
| 368 | while (--i) |
| 369 | *(p++) = c; |
| 370 | } |
328 | 371 | break; |
| 372 | case ' ': |
| 373 | if (use_colors && visible_tws && q >= tws) { |
| 374 | *(p++) |= '.' | MOD_WHITESPACE; |
| 375 | col++; |
| 376 | break; |
| 377 | } |
| 378 | /* fallthrough */ |
329 | 379 | default: |
330 | 380 | c = convert_to_display_c (c); |
… |
… |
|
352 | 402 | break; |
353 | 403 | } |
| 404 | q++; |
354 | 405 | } |
355 | 406 | } |
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 |