xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit a73039c57111fae98afc3bbb47276d744890cc93

Unsupported color in :highlight is no hard error
Otherwise colorscheme fallback doesn't work smoothly as there are lots
of error messages.
Author: xaizek
Author date (UTC): 2023-03-17 11:57
Committer name: xaizek
Committer date (UTC): 2023-03-17 11:57
Parent(s): 8c17d9229019cc8b33d31faf7253ffd5f8a4d3b7
Signing key: 99DC5E4DB05F6BE2
Tree: 5faae796e915be1a3cdc54b12bc46209641ec454
File Lines added Lines deleted
src/cmd_handlers.c 9 5
File src/cmd_handlers.c changed (mode: 100644) (index b1395d1a9..43f5ac4d4)
... ... parse_file_highlight(const cmd_info_t *cmd_info, col_attr_t *color)
3106 3106 { {
3107 3107 if(try_parse_cterm_color(equal + 1, 0, color) != 0) if(try_parse_cterm_color(equal + 1, 0, color) != 0)
3108 3108 { {
3109 return CMDS_ERR_CUSTOM;
3109 /* Color not supported by the current terminal is not a hard error. */
3110 return 1;
3110 3111 } }
3111 3112 } }
3112 3113 else if(strcmp(arg_name, "ctermfg") == 0) else if(strcmp(arg_name, "ctermfg") == 0)
3113 3114 { {
3114 3115 if(try_parse_cterm_color(equal + 1, 1, color) != 0) if(try_parse_cterm_color(equal + 1, 1, color) != 0)
3115 3116 { {
3116 return CMDS_ERR_CUSTOM;
3117 /* Color not supported by the current terminal is not a hard error. */
3118 return 1;
3117 3119 } }
3118 3120 } }
3119 3121 else if(strcmp(arg_name, "guibg") == 0) else if(strcmp(arg_name, "guibg") == 0)
 
... ... parse_file_highlight(const cmd_info_t *cmd_info, col_attr_t *color)
3121 3123 int value; int value;
3122 3124 if(try_parse_gui_color(equal + 1, &value) != 0) if(try_parse_gui_color(equal + 1, &value) != 0)
3123 3125 { {
3124 return CMDS_ERR_CUSTOM;
3126 /* Color not supported by the current terminal is not a hard error. */
3127 return 1;
3125 3128 } }
3126 3129
3127 3130 cs_color_enable_gui(color); cs_color_enable_gui(color);
 
... ... parse_file_highlight(const cmd_info_t *cmd_info, col_attr_t *color)
3132 3135 int value; int value;
3133 3136 if(try_parse_gui_color(equal + 1, &value) != 0) if(try_parse_gui_color(equal + 1, &value) != 0)
3134 3137 { {
3135 return CMDS_ERR_CUSTOM;
3138 /* Color not supported by the current terminal is not a hard error. */
3139 return 1;
3136 3140 } }
3137 3141
3138 3142 cs_color_enable_gui(color); cs_color_enable_gui(color);
 
... ... try_parse_cterm_color(const char str[], int is_fg, col_attr_t *color)
3192 3196 cs->state = CSS_BROKEN; cs->state = CSS_BROKEN;
3193 3197 } }
3194 3198
3195 return CMDS_ERR_CUSTOM;
3199 return 1;
3196 3200 } }
3197 3201
3198 3202 if(is_fg) if(is_fg)
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master