fix(readonly): change module to match docs (#1728)

This commit is contained in:
David Knaack 2020-10-02 19:10:46 +02:00 committed by GitHub
parent f7f59cd996
commit b633248606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -13,8 +13,8 @@ pub struct DirectoryConfig<'a> {
pub format: &'a str,
pub style: &'a str,
pub disabled: bool,
pub read_only_symbol: &'a str,
pub read_only_symbol_style: &'a str,
pub read_only: &'a str,
pub read_only_style: &'a str,
}
impl<'a> RootModuleConfig<'a> for DirectoryConfig<'a> {
@ -28,8 +28,8 @@ impl<'a> RootModuleConfig<'a> for DirectoryConfig<'a> {
format: "[$path]($style)[$read_only]($read_only_style) ",
style: "cyan bold",
disabled: false,
read_only_symbol: "🔒",
read_only_symbol_style: "red",
read_only: "🔒",
read_only_style: "red",
}
}
}

View File

@ -97,13 +97,13 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
String::from("")
};
let final_dir_string = format!("{}{}", fish_prefix, truncated_dir_string);
let lock_symbol = String::from(config.read_only_symbol);
let lock_symbol = String::from(config.read_only);
let parsed = StringFormatter::new(config.format).and_then(|formatter| {
formatter
.map_style(|variable| match variable {
"style" => Some(Ok(config.style)),
"read_only_style" => Some(Ok(config.read_only_symbol_style)),
"read_only_style" => Some(Ok(config.read_only_style)),
_ => None,
})
.map(|variable| match variable {