mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 08:48:23 +01:00
add magenta to ansi command as synonym for purple (#7785)
# Description Added `magenta` as a synonym for Purple in the ansi command. Previously, ansi errored out on `ansi magenta` as the `AnsiCode` vec didn't have magenta as a name as seen in #7747. <img width="909" alt="image" src="https://user-images.githubusercontent.com/101823296/213012495-10bb29e3-b6d3-4fdc-bc3c-cb8a891c2bc2.png"> # User-Facing Changes Users can now use the ANSI standard name `magenta`.
This commit is contained in:
parent
adcc74ab8d
commit
be32aeee70
@ -114,6 +114,22 @@ static CODE_LIST: Lazy<Vec<AnsiCode>> = Lazy::new(|| { vec![
|
||||
AnsiCode{ short_name: Some("lpr"), long_name: "light_purple_reverse", code: Color::LightPurple.reverse().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("bg_lp"), long_name: "bg_light_purple", code: Style::new().on(Color::LightPurple).prefix().to_string()},
|
||||
|
||||
AnsiCode{ short_name: Some("m"), long_name: "magenta", code: Color::Purple.prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("mb"), long_name: "magenta_bold", code: Color::Purple.bold().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("mu"), long_name: "magenta_underline", code: Color::Purple.underline().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("mi"), long_name: "magenta_italic", code: Color::Purple.italic().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("md"), long_name: "magenta_dimmed", code: Color::Purple.dimmed().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("mr"), long_name: "magenta_reverse", code: Color::Purple.reverse().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("bg_m"), long_name: "bg_magenta", code: Style::new().on(Color::Purple).prefix().to_string()},
|
||||
|
||||
AnsiCode{ short_name: Some("lm"), long_name: "light_magenta", code: Color::LightPurple.prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("lmb"), long_name: "light_magenta_bold", code: Color::LightPurple.bold().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("lmu"), long_name: "light_magenta_underline", code: Color::LightPurple.underline().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("lmi"), long_name: "light_magenta_italic", code: Color::LightPurple.italic().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("lmd"), long_name: "light_magenta_dimmed", code: Color::LightPurple.dimmed().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("lmr"), long_name: "light_magenta_reverse", code: Color::LightPurple.reverse().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("bg_lm"), long_name: "bg_light_magenta", code: Style::new().on(Color::LightPurple).prefix().to_string()},
|
||||
|
||||
AnsiCode{ short_name: Some("c"), long_name: "cyan", code: Color::Cyan.prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("cb"), long_name: "cyan_bold", code: Color::Cyan.bold().prefix().to_string()},
|
||||
AnsiCode{ short_name: Some("cu"), long_name: "cyan_underline", code: Color::Cyan.underline().prefix().to_string()},
|
||||
@ -764,7 +780,7 @@ fn generate_ansi_code_list(
|
||||
let name: Value = Value::string(String::from(ansi_code.long_name), call_span);
|
||||
let short_name = Value::string(ansi_code.short_name.unwrap_or(""), call_span);
|
||||
// The first 102 items in the ansi array are colors
|
||||
let preview = if i < 375 {
|
||||
let preview = if i < 389 {
|
||||
Value::string(format!("{}NUSHELL\u{1b}[0m", &ansi_code.code), call_span)
|
||||
} else {
|
||||
Value::string("\u{1b}[0m", call_span)
|
||||
|
Loading…
Reference in New Issue
Block a user