diff options
author | Jan Katins <jasc@gmx.net> | 2020-09-26 09:35:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-26 09:35:41 +0200 |
commit | c93bd7b705919966c90f5879bb8aaf4d22cf058c (patch) | |
tree | a69b6f7eec153632d098d009679081ee0c1cc8d2 /src/modules/shlvl.rs | |
parent | ffb13450529f319ac54e2dacccb897fb22632e3d (diff) |
fix: actually disable per default disabled modules (#1677)
The default `disabled: true` is actually only available within the module (when the config struct is used and not the user toml) but not all (the hg_branch) modules checked it there again.
Document this in all places and add the check (+ test) to the hg_branch module.
Diffstat (limited to 'src/modules/shlvl.rs')
-rw-r--r-- | src/modules/shlvl.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/shlvl.rs b/src/modules/shlvl.rs index 2118c8010..b21f91219 100644 --- a/src/modules/shlvl.rs +++ b/src/modules/shlvl.rs @@ -12,6 +12,8 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { let mut module = context.new_module("shlvl"); let config: ShLvlConfig = ShLvlConfig::try_load(module.config); + // As we default to disabled=true, we have to check here after loading our config module, + // before it was only checking against whatever is in the config starship.toml if config.disabled || shlvl < config.threshold { return None; } @@ -45,6 +47,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { Some(module) } + #[cfg(test)] mod tests { use ansi_term::{Color, Style}; |