diff options
author | Kevin Song <chipbuster@users.noreply.github.com> | 2019-09-07 19:33:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-07 19:33:06 -0500 |
commit | 9721666d331ddfd7a04bbb434cccf38b44701b00 (patch) | |
tree | 8edb32e1cebc6951451953a311cd9cfb4447712d /src/modules/golang.rs | |
parent | 3e5cac98522feca856867e32cf3df52ff0285c62 (diff) |
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.
Diffstat (limited to 'src/modules/golang.rs')
-rw-r--r-- | src/modules/golang.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/golang.rs b/src/modules/golang.rs index 0114c30de..bf632bf72 100644 --- a/src/modules/golang.rs +++ b/src/modules/golang.rs @@ -28,10 +28,12 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { match get_go_version() { Some(go_version) => { const GO_CHAR: &str = "🐹 "; - let module_color = Color::Cyan.bold(); let mut module = context.new_module("golang")?; - module.set_style(module_color); + let module_style = module + .config_value_style("style") + .unwrap_or_else(|| Color::Cyan.bold()); + module.set_style(module_style); let formatted_version = format_go_version(&go_version)?; module.new_segment("symbol", GO_CHAR); |