mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 08:11:15 -03:00
fish_color_valid_path: respect explicit normal foreground
This commit is contained in:
@@ -189,13 +189,10 @@ fn resolve_spec_uncached(highlight: &HighlightSpec, vars: &dyn Environment) -> T
|
||||
// Handle modifiers.
|
||||
if highlight.valid_path {
|
||||
if let Some(valid_path_var) = vars.get(L!("fish_color_valid_path")) {
|
||||
let valid_path_face = parse_text_face(valid_path_var.as_list());
|
||||
// Historical behavior is to not apply background.
|
||||
let valid_path_face = parse_text_face_for_highlight(&valid_path_var)
|
||||
.unwrap_or(TextFace::terminal_default());
|
||||
// Apply the foreground, except if it's normal. The intention here is likely
|
||||
// to only override foreground if the valid path color has an explicit foreground.
|
||||
if !valid_path_face.fg.is_normal() {
|
||||
face.fg = valid_path_face.fg;
|
||||
if let Some(fg) = valid_path_face.fg {
|
||||
face.fg = fg;
|
||||
}
|
||||
face.style = face.style.union_prefer_right(valid_path_face.style);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user