File src/color_scheme.c changed (mode: 100644) (index 216e3b884..687cb6aac) |
... |
... |
write_color_scheme_file(void) |
399 |
399 |
{ |
{ |
400 |
400 |
FILE *fp; |
FILE *fp; |
401 |
401 |
char colors_dir[PATH_MAX]; |
char colors_dir[PATH_MAX]; |
402 |
|
int y; |
|
|
402 |
|
int i; |
403 |
403 |
|
|
404 |
404 |
snprintf(colors_dir, sizeof(colors_dir), "%s/colors", cfg.config_dir); |
snprintf(colors_dir, sizeof(colors_dir), "%s/colors", cfg.config_dir); |
405 |
405 |
if(make_dir(colors_dir, 0777) != 0) |
if(make_dir(colors_dir, 0777) != 0) |
|
... |
... |
write_color_scheme_file(void) |
454 |
454 |
|
|
455 |
455 |
fprintf(fp, "\" highlight group cterm=attrs ctermfg=foreground_color ctermbg=background_color\n\n"); |
fprintf(fp, "\" highlight group cterm=attrs ctermfg=foreground_color ctermbg=background_color\n\n"); |
456 |
456 |
|
|
457 |
|
for(y = 0; y < MAXNUM_COLOR - 2; y++) |
|
|
457 |
|
for(i = 0; i < MAXNUM_COLOR - 2; ++i) |
458 |
458 |
{ |
{ |
459 |
459 |
char fg_buf[16], bg_buf[16]; |
char fg_buf[16], bg_buf[16]; |
460 |
460 |
|
|
461 |
|
if(y == OTHER_LINE_COLOR) |
|
|
461 |
|
if(i == OTHER_LINE_COLOR) |
462 |
462 |
{ |
{ |
463 |
463 |
/* Skip OtherLine as there is no way to express defaults. */ |
/* Skip OtherLine as there is no way to express defaults. */ |
464 |
464 |
continue; |
continue; |
465 |
465 |
} |
} |
466 |
466 |
|
|
467 |
|
color_to_str(cfg.cs.color[y].fg, sizeof(fg_buf), fg_buf); |
|
468 |
|
color_to_str(cfg.cs.color[y].bg, sizeof(bg_buf), bg_buf); |
|
|
467 |
|
color_to_str(cfg.cs.color[i].fg, sizeof(fg_buf), fg_buf); |
|
468 |
|
color_to_str(cfg.cs.color[i].bg, sizeof(bg_buf), bg_buf); |
469 |
469 |
|
|
470 |
|
fprintf(fp, "highlight %s cterm=%s ctermfg=%s ctermbg=%s\n", HI_GROUPS[y], |
|
471 |
|
attrs_to_str(cfg.cs.color[y].attr), fg_buf, bg_buf); |
|
|
470 |
|
fprintf(fp, "highlight %s cterm=%s ctermfg=%s ctermbg=%s\n", HI_GROUPS[i], |
|
471 |
|
attrs_to_str(cfg.cs.color[i].attr), fg_buf, bg_buf); |
472 |
472 |
} |
} |
473 |
473 |
|
|
474 |
474 |
fclose(fp); |
fclose(fp); |