mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-28 15:56:28 +00:00
fix(readonly): change module to match docs (#1728)
This commit is contained in:
parent
f7f59cd996
commit
b633248606
@ -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",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user