Get rid of header bold option (#4076)

* refactor(options): get rid of 'header_bold' option

* docs(config): remove 'header_bold' from docs

* fix(options): replicate logic to apply true/false in bold

* style(options): apply lint fixes
This commit is contained in:
Oscar Dominguez
2021-10-30 19:59:19 +02:00
committed by GitHub
parent 75782f0f50
commit f94a3e15f5
5 changed files with 32 additions and 40 deletions

View File

@ -102,7 +102,6 @@ pub fn string_to_lookup_value(str_prim: &str) -> String {
"separator_color" => "separator_color".to_string(),
"header_align" => "header_align".to_string(),
"header_color" => "header_color".to_string(),
"header_bold" => "header_bold".to_string(),
"header_style" => "header_style".to_string(),
"index_color" => "index_color".to_string(),
"leading_trailing_space_bg" => "leading_trailing_space_bg".to_string(),
@ -144,7 +143,6 @@ pub fn get_color_config(config: &NuConfig) -> HashMap<String, Style> {
hm.insert("separator_color".to_string(), Color::White.normal());
hm.insert("header_align".to_string(), Color::Green.bold());
hm.insert("header_color".to_string(), Color::Green.bold());
hm.insert("header_bold".to_string(), Color::Green.bold());
hm.insert("header_style".to_string(), Style::default());
hm.insert("index_color".to_string(), Color::Green.bold());
hm.insert(
@ -204,9 +202,6 @@ pub fn get_color_config(config: &NuConfig) -> HashMap<String, Style> {
"header_color" => {
update_hashmap(key, value, &mut hm);
}
"header_bold" => {
update_hashmap(key, value, &mut hm);
}
"header_style" => {
update_hashmap(key, value, &mut hm);
}
@ -358,14 +353,7 @@ pub fn style_primitive(primitive: &str, color_hm: &HashMap<String, Style>) -> Te
let style = color_hm.get("header_color");
match style {
Some(s) => TextStyle::with_style(Alignment::Center, *s),
None => TextStyle::default_header(),
}
}
"header_bold" => {
let style = color_hm.get("header_bold");
match style {
Some(s) => TextStyle::with_style(Alignment::Center, *s),
None => TextStyle::default_header(),
None => TextStyle::default_header().bold(Some(true)),
}
}
"header_style" => {