From e006ab13eea45c06ec22d01e3bd72aa8b53a777f Mon Sep 17 00:00:00 2001 From: Nicholas Todoroff Date: Wed, 2 Aug 2023 16:53:12 -0600 Subject: Fix typo HEADINGD_ODD -> HEADINGS_ODD --- src/doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc b/src/doc index 68e619a..876b9bc 100755 --- a/src/doc +++ b/src/doc @@ -870,7 +870,7 @@ Commands for handling cell content: Some terminal dont support some attributes, such as italic. The value of type shall be one of the following: - HEADINGS, HEADINGD_ODD, MODE, NUMB, STRG, DATEF, + HEADINGS, HEADINGS_ODD, MODE, NUMB, STRG, DATEF, EXPRESSION, GRID_EVEN, GRID_ODD, CELL_ERROR, CELL_NEGATIVE, CELL_SELECTION, CELL_SELECTION_SC, INFO_MSG, ERROR_MSG, CELL_ID, -- cgit v1.2.3 From 655ed9cb245bfddb79a22b3fa155eba293a2bc5f Mon Sep 17 00:00:00 2001 From: Nicholas Todoroff Date: Wed, 2 Aug 2023 17:16:35 -0600 Subject: Properly handle NONE_COLOR as described in :help * Adds entry for NONE_COLOR in set_colors_param_dict() * Makes chg_color() not error nor change the color when fg or bg is "NONE_COLOR" --- src/color.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/color.c b/src/color.c index c8aeedb..49ea6ee 100644 --- a/src/color.c +++ b/src/color.c @@ -186,6 +186,8 @@ void set_colors_param_dict() { sprintf(str, "%d", DEFAULT_COLOR); put(d_colors_param, "DEFAULT_COLOR", str); + sprintf(str, "%d", NONE_COLOR); + put(d_colors_param, "NONE_COLOR", str); sprintf(str, "%d", BLACK); put(d_colors_param, "BLACK", str); sprintf(str, "%d", RED); @@ -333,13 +335,17 @@ void chg_color(char * str) { // Change the color int type = get_int(d_colors_param, get(d, "type")); struct custom_color * cc; - if ((cc = get_custom_color(get(d, "bg"))) != NULL) { // bg is custom color + if (get_int(d_colors_param, get(d, "bg")) == NONE_COLOR) { + // Don't change anything + } else if ((cc = get_custom_color(get(d, "bg"))) != NULL) { // bg is custom color ucolors[ type ].bg = 7 + cc->number; } else { // bg is stock ncurses color ucolors[ type ].bg = get_int(d_colors_param, get(d, "bg")); } - if ((cc = get_custom_color(get(d, "fg"))) != NULL) { // fg is custom color + if (get_int(d_colors_param, get(d, "fg")) == NONE_COLOR) { + // Don't change anything + } else if ((cc = get_custom_color(get(d, "fg"))) != NULL) { // fg is custom color ucolors[ type ].fg = 7 + cc->number; } else { // fg is stock ncurses color ucolors[ type ].fg = get_int(d_colors_param, get(d, "fg")); -- cgit v1.2.3