diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index c2bc31573..0f0db029c 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -134,7 +134,7 @@ Variable Meaning ``fish_color_search_match`` history search matches and selected pager items (background only) ========================================== ===================================================================== -If a variable isn't set, fish usually tries ``$fish_color_normal``, except for: +If a variable isn't set or is empty, fish usually tries ``$fish_color_normal``, except for: - ``$fish_color_keyword``, where it tries ``$fish_color_command`` first. - ``$fish_color_option``, where it tries ``$fish_color_param`` first. @@ -178,7 +178,7 @@ Variable Meaning ``fish_pager_color_secondary_description`` description of every second unselected completion ========================================== =========================================================== -When the secondary or selected variables aren't set, the normal variables are used, except for ``$fish_pager_color_selected_background``, where the background of ``$fish_color_search_match`` is tried first. +When the secondary or selected variables aren't set or are empty, the normal variables are used, except for ``$fish_pager_color_selected_background``, where the background of ``$fish_color_search_match`` is tried first. .. _abbreviations: diff --git a/src/highlight.cpp b/src/highlight.cpp index 67e582b81..4d30fc9b7 100644 --- a/src/highlight.cpp +++ b/src/highlight.cpp @@ -337,8 +337,8 @@ rgb_color_t highlight_color_resolver_t::resolve_spec_uncached(const highlight_sp highlight_role_t role = is_background ? highlight.background : highlight.foreground; auto var = vars.get(get_highlight_var_name(role)); - if (!var) var = vars.get(get_highlight_var_name(get_fallback(role))); - if (!var) var = vars.get(get_highlight_var_name(highlight_role_t::normal)); + if (var.missing_or_empty()) var = vars.get(get_highlight_var_name(get_fallback(role))); + if (var.missing_or_empty()) var = vars.get(get_highlight_var_name(highlight_role_t::normal)); if (var) result = parse_color(*var, is_background); // Handle modifiers.