diff options
author | 2014-01-22 17:45:27 -0800 | |
---|---|---|
committer | 2014-01-22 17:45:27 -0800 | |
commit | 7d3f808e4c48d3cb54cb603b94901eaa6078b70c (patch) | |
tree | 224cf3c48732c6615ff64a49be5f99b0dd40fb72 /highlight.cpp | |
parent | ee9a4082b6a313dc15fcb24801cc54937777c662 (diff) |
Various tweaks and improvements to new pager, including disclosure
feature
Diffstat (limited to 'highlight.cpp')
-rw-r--r-- | highlight.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/highlight.cpp b/highlight.cpp index 31ea2c8e..f2ae460c 100644 --- a/highlight.cpp +++ b/highlight.cpp @@ -361,7 +361,10 @@ bool plain_statement_get_expanded_command(const wcstring &src, const parse_node_ rgb_color_t highlight_get_color(highlight_spec_t highlight, bool is_background) { rgb_color_t result = rgb_color_t::normal(); - + + /* If sloppy_background is set, then we look at the foreground color even if is_background is set */ + bool treat_as_background = is_background && ! (highlight & highlight_modifier_sloppy_background); + /* Get the primary variable */ size_t idx = highlight_get_primary(highlight); if (idx >= VAR_COUNT) @@ -377,9 +380,9 @@ rgb_color_t highlight_get_color(highlight_spec_t highlight, bool is_background) val_wstr = env_get_string(highlight_var[0]); if (! val_wstr.missing()) - result = parse_color(val_wstr, is_background); + result = parse_color(val_wstr, treat_as_background); - /* Handle modifiers. Just one for now */ + /* Handle modifiers. */ if (highlight & highlight_modifier_valid_path) { env_var_t val2_wstr = env_get_string(L"fish_color_valid_path"); |