mirror of
https://github.com/nushell/nushell.git
synced 2025-04-11 06:48:31 +02:00
explore
: remove unused colour config code (#10570)
Remove code for 2 no-longer-used configuration options in `explore`: `explore.config.cursor_color` and `explore.config.border_color`. Think I made these unnecessary in https://github.com/nushell/nushell/pull/10533 and https://github.com/nushell/nushell/pull/10270 but missed this code, my bad. The `explore` config code is a little hard to follow because it does so many key lookups in hashmaps.
This commit is contained in:
parent
4dbbacc35d
commit
b9ecfeb890
@ -209,8 +209,6 @@ fn prepare_default_config(config: &mut HashMap<String, Value>) {
|
|||||||
|
|
||||||
const TABLE_SELECT_COLUMN: Style = color(None, None);
|
const TABLE_SELECT_COLUMN: Style = color(None, None);
|
||||||
|
|
||||||
const CONFIG_CURSOR_COLOR: Style = color(Some(Color::Black), Some(Color::LightYellow));
|
|
||||||
|
|
||||||
insert_style(config, "status_bar_background", STATUS_BAR);
|
insert_style(config, "status_bar_background", STATUS_BAR);
|
||||||
insert_style(config, "command_bar_text", INPUT_BAR);
|
insert_style(config, "command_bar_text", INPUT_BAR);
|
||||||
insert_style(config, "highlight", HIGHLIGHT);
|
insert_style(config, "highlight", HIGHLIGHT);
|
||||||
@ -244,17 +242,6 @@ fn prepare_default_config(config: &mut HashMap<String, Value>) {
|
|||||||
|
|
||||||
config.insert(String::from("table"), map_into_value(hm));
|
config.insert(String::from("table"), map_into_value(hm));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
let mut hm = config
|
|
||||||
.get("config")
|
|
||||||
.and_then(parse_hash_map)
|
|
||||||
.unwrap_or_default();
|
|
||||||
|
|
||||||
insert_style(&mut hm, "cursor_color", CONFIG_CURSOR_COLOR);
|
|
||||||
|
|
||||||
config.insert(String::from("config"), map_into_value(hm));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_hash_map(value: &Value) -> Option<HashMap<String, Value>> {
|
fn parse_hash_map(value: &Value) -> Option<HashMap<String, Value>> {
|
||||||
@ -307,7 +294,6 @@ fn insert_bool(map: &mut HashMap<String, Value>, key: &str, value: bool) {
|
|||||||
fn include_nu_config(config: &mut HashMap<String, Value>, style_computer: &StyleComputer) {
|
fn include_nu_config(config: &mut HashMap<String, Value>, style_computer: &StyleComputer) {
|
||||||
let line_color = lookup_color(style_computer, "separator");
|
let line_color = lookup_color(style_computer, "separator");
|
||||||
if line_color != nu_ansi_term::Style::default() {
|
if line_color != nu_ansi_term::Style::default() {
|
||||||
{
|
|
||||||
let mut map = config
|
let mut map = config
|
||||||
.get("table")
|
.get("table")
|
||||||
.and_then(parse_hash_map)
|
.and_then(parse_hash_map)
|
||||||
@ -315,18 +301,6 @@ fn include_nu_config(config: &mut HashMap<String, Value>, style_computer: &Style
|
|||||||
insert_style(&mut map, "split_line", line_color);
|
insert_style(&mut map, "split_line", line_color);
|
||||||
config.insert(String::from("table"), map_into_value(map));
|
config.insert(String::from("table"), map_into_value(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
let mut map = config
|
|
||||||
.get("config")
|
|
||||||
.and_then(parse_hash_map)
|
|
||||||
.unwrap_or_default();
|
|
||||||
|
|
||||||
insert_style(&mut map, "border_color", line_color);
|
|
||||||
|
|
||||||
config.insert(String::from("config"), map_into_value(map));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lookup_color(style_computer: &StyleComputer, key: &str) -> nu_ansi_term::Style {
|
fn lookup_color(style_computer: &StyleComputer, key: &str) -> nu_ansi_term::Style {
|
||||||
|
Loading…
Reference in New Issue
Block a user