mirror of
https://github.com/starship/starship.git
synced 2026-06-24 02:01:36 +07:00
feat: Add a disabled configuration option for modules (#86)
• Add support for the disabled configuration option
This will allow you to selectively disable modules that you don't want or need. 😄
• Overwrite starship configuration file path with STARSHIP_CONFIG environment variable
• Write tests for the two configuration options that are available
This commit is contained in:
@@ -17,7 +17,7 @@ use super::{Context, Module};
|
||||
/// - `+` — A new file has been added to the staging area
|
||||
/// - `»` — A renamed file has been added to the staging area
|
||||
/// - `✘` — A file's deletion has been added to the staging area
|
||||
pub fn segment<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
// This is the order that the sections will appear in
|
||||
const GIT_STATUS_CONFLICTED: &str = "=";
|
||||
const GIT_STATUS_AHEAD: &str = "⇡";
|
||||
@@ -35,7 +35,7 @@ pub fn segment<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
let repository = Repository::open(repo_root).ok()?;
|
||||
|
||||
let module_style = Color::Red.bold();
|
||||
let mut module = context.new_module("git_status");
|
||||
let mut module = context.new_module("git_status")?;
|
||||
module.get_prefix().set_value("[").set_style(module_style);
|
||||
module.get_suffix().set_value("] ").set_style(module_style);
|
||||
module.set_style(module_style);
|
||||
|
||||
Reference in New Issue
Block a user