Color info for config.toml (#2478)

* WIP - compiling but not working

* semi-working

* making progress

* working except for table lines

* fmt + clippy

* cleaned up some comments

* working line colors

* fmt, clippy, updated sample config.toml

* merges

* some info on how to set colors
This commit is contained in:
Darren Schroeder 2020-09-01 08:48:27 -05:00 committed by GitHub
parent adbbcafd30
commit 569345e1d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View File

@ -652,6 +652,7 @@ impl WrappedTable {
}
println!("{}", output);
// println!("{:#?}", output);
}
fn print_cell_contents(&self, cells: &[WrappedCell], color_hm: &HashMap<String, Style>) {
@ -677,6 +678,7 @@ impl WrappedTable {
let remainder = self.column_widths[column.0] - line.width;
output.push(' ');
// println!("Column1: [{:?}]", column.1.style);
match column.1.style.alignment {
Alignment::Left => {
if let Some(color) = column.1.style.color_style {

View File

@ -14,6 +14,26 @@ complete_from_path = true
rm_always_trash = true
prompt = "echo [ $(ansi gb) $(pwd) $(ansi reset) \"(\" $(ansi cb) $(do -i { git rev-parse --abbrev-ref HEAD | trim }) $(ansi reset) \")\" $(char newline) $(ansi yb) $(date --format \"%m/%d/%Y %I:%M:%S%.3f %p\" --raw) $(ansi reset) \"> \" ] | str collect"
# for each of the options in the color_config section, you are able to set
# the color alone or with one of the following attributes.
# color, abbreviation
# green g
# red r
# blue u
# black b
# yellow y
# purple p
# cyan c
# white w
# attribute, abbreviation
# bold b
# underline u
# italic i
# dimmed d
# reverse r
# abbreviated: green bold = gb, red underline = ru, blue dimmed = ud
# or verbose: green_bold, red_underline, blue_dimmed
[color_config]
primitive_int = "green"
primitive_decimal = "red"
@ -32,7 +52,6 @@ separator_color = "purple"
header_align = "l" # left|l, right|r, center|c
header_color = "c" # green|g, red|r, blue|u, black|b, yellow|y, purple|p, cyan|c, white|w
header_bold = true
header_style = "cb"
index_color = "rd"
[line_editor]