diff options
author | Vinzent Steinberg <Vinzent.Steinberg@gmail.com> | 2019-07-24 15:29:55 +0200 |
---|---|---|
committer | Vinzent Steinberg <Vinzent.Steinberg@gmail.com> | 2019-07-24 15:29:55 +0200 |
commit | 3baf7f31b91c71ba0acb2be886a47ccbd2b295fb (patch) | |
tree | e704edc5e73085139f8a3747bac05ce1d9866a0d /src/interactive/widgets/mark.rs | |
parent | 977e69f9aafc54f9b2ed9ddb2eee5164e30b213c (diff) |
Use same colors in mark pane as in entries pane
This required passing the information whether a path is a directory
accordingly.
Diffstat (limited to 'src/interactive/widgets/mark.rs')
-rw-r--r-- | src/interactive/widgets/mark.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/interactive/widgets/mark.rs b/src/interactive/widgets/mark.rs index 49a4128..702c187 100644 --- a/src/interactive/widgets/mark.rs +++ b/src/interactive/widgets/mark.rs @@ -33,6 +33,7 @@ pub struct EntryMark { pub path: PathBuf, pub index: usize, pub num_errors_during_deletion: usize, + pub is_dir: bool, } #[derive(Default)] @@ -62,7 +63,7 @@ impl MarkPane { self.selected = None } } - pub fn toggle_index(mut self, index: TreeIndex, tree: &Tree) -> Option<Self> { + pub fn toggle_index(mut self, index: TreeIndex, tree: &Tree, is_dir: bool) -> Option<Self> { match self.marked.entry(index) { Entry::Vacant(entry) => { if let Some(e) = tree.node_weight(index) { @@ -73,6 +74,7 @@ impl MarkPane { path: path_of(tree, index), index: sorting_index, num_errors_during_deletion: 0, + is_dir, }); } } @@ -258,7 +260,7 @@ impl MarkPane { _ => (path, num_path_graphemes), } }; - let fg_path = get_name_color(Color::Reset, false, true); // TODO: determine whether directory + let fg_path = get_name_color(Color::Reset, !v.is_dir, true); let path = Text::Styled( path.into(), Style { |