From a0ce277ef3aec05a3eb9de9341f8d13f5f3b6ecd Mon Sep 17 00:00:00 2001 From: bee-plus <76763371+bee-plus@users.noreply.github.com> Date: Tue, 8 Oct 2024 01:29:33 -0500 Subject: [PATCH] fix: colour file kind indicators Uses the punctuation style. --- src/output/file_name.rs | 7 +++++-- src/theme/mod.rs | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/output/file_name.rs b/src/output/file_name.rs index ae232a3d9..a6f9a194c 100644 --- a/src/output/file_name.rs +++ b/src/output/file_name.rs @@ -291,7 +291,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { if should_add_classify_char { if let Some(class) = self.classify_char(target) { - bits.push(Style::default().paint(class)); + bits.push(self.colours.classify_char().paint(class)); } } } @@ -317,7 +317,7 @@ impl<'a, 'dir, C: Colours> FileName<'a, 'dir, C> { } } else if should_add_classify_char { if let Some(class) = self.classify_char(self.file) { - bits.push(Style::default().paint(class)); + bits.push(self.colours.classify_char().paint(class)); } } @@ -541,6 +541,9 @@ pub trait Colours: FiletypeColours { /// The style to paint a directory that has a filesystem mounted on it. fn mount_point(&self) -> Style; + /// The style to paint a file kind indicator. + fn classify_char(&self) -> Style; + fn colour_file(&self, file: &File<'_>) -> Style; fn style_override(&self, file: &File<'_>) -> Option; diff --git a/src/theme/mod.rs b/src/theme/mod.rs index c62abc1db..b0099500e 100644 --- a/src/theme/mod.rs +++ b/src/theme/mod.rs @@ -412,6 +412,7 @@ impl FileNameColours for Theme { fn broken_control_char(&self) -> Style { apply_overlay(self.ui.control_char(), self.ui.broken_path_overlay()) } fn executable_file(&self) -> Style { self.ui.filekinds.unwrap_or_default().executable() } fn mount_point(&self) -> Style { self.ui.filekinds.unwrap_or_default().mount_point() } + fn classify_char(&self) -> Style { self.ui.punctuation() } fn colour_file(&self, file: &File<'_>) -> Style { self.exts