diff options
author | DLFW <daniel@llin.info> | 2021-06-28 02:56:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 20:56:28 -0400 |
commit | 8cefdc24500864993e66d28ba198070906161b67 (patch) | |
tree | 6f81e82b1a5777601fa55cebd6c0c9c187fec105 /src/config | |
parent | fe87911dbbdd0c20acef825a0bb6213e011fca02 (diff) |
highlight invalid symlinks (#80)
* own display style for invalid symlinks
* add link_invalid to default theme.toml
* footer shows link target in link style
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/theme/app_theme.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config/theme/app_theme.rs b/src/config/theme/app_theme.rs index 5b05fd3..1b7eab5 100644 --- a/src/config/theme/app_theme.rs +++ b/src/config/theme/app_theme.rs @@ -19,6 +19,8 @@ pub struct RawAppTheme { #[serde(default)] pub link: RawAppStyle, #[serde(default)] + pub link_invalid: RawAppStyle, + #[serde(default)] pub socket: RawAppStyle, #[serde(default)] pub ext: HashMap<String, RawAppStyle>, @@ -32,6 +34,7 @@ impl std::default::Default for RawAppTheme { directory: RawAppStyle::default(), executable: RawAppStyle::default(), link: RawAppStyle::default(), + link_invalid: RawAppStyle::default(), socket: RawAppStyle::default(), ext: HashMap::default(), } @@ -45,6 +48,7 @@ impl Flattenable<AppTheme> for RawAppTheme { let regular = self.regular.to_style_theme(); let directory = self.directory.to_style_theme(); let link = self.link.to_style_theme(); + let link_invalid = self.link_invalid.to_style_theme(); let socket = self.socket.to_style_theme(); let ext: HashMap<String, AppStyle> = self .ext @@ -61,6 +65,7 @@ impl Flattenable<AppTheme> for RawAppTheme { regular, directory, link, + link_invalid, socket, ext, } @@ -74,6 +79,7 @@ pub struct AppTheme { pub directory: AppStyle, pub executable: AppStyle, pub link: AppStyle, + pub link_invalid: AppStyle, pub socket: AppStyle, pub ext: HashMap<String, AppStyle>, } @@ -99,6 +105,9 @@ impl std::default::Default for AppTheme { let link = AppStyle::default() .set_fg(Color::LightCyan) .insert(Modifier::BOLD); + let link_invalid = AppStyle::default() + .set_fg(Color::Red) + .insert(Modifier::BOLD); let socket = AppStyle::default() .set_fg(Color::LightMagenta) .insert(Modifier::BOLD); @@ -110,6 +119,7 @@ impl std::default::Default for AppTheme { regular, directory, link, + link_invalid, socket, ext, } |