feat: Add the ability to configure per-module color styles (#285)

Add parsing logic, config support, docs, and integration with other modules 
for custom styling of each module.
This commit is contained in:
Kevin Song
2019-09-07 19:33:06 -05:00
committed by GitHub
parent 3e5cac9852
commit 9721666d33
21 changed files with 485 additions and 184 deletions
+4 -2
View File
@@ -22,10 +22,12 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
match get_ruby_version() {
Some(ruby_version) => {
const RUBY_CHAR: &str = "💎 ";
let module_color = Color::Red.bold();
let mut module = context.new_module("ruby")?;
module.set_style(module_color);
let module_style = module
.config_value_style("style")
.unwrap_or_else(|| Color::Red.bold());
module.set_style(module_style);
let formatted_version = format_ruby_version(&ruby_version)?;
module.new_segment("symbol", RUBY_CHAR);