|
@@ -140,6 +140,9 @@ pub struct Details {
|
|
|
/// The colours to use to display information in the table, including the
|
|
/// The colours to use to display information in the table, including the
|
|
|
/// colour of the tree view symbols.
|
|
/// colour of the tree view symbols.
|
|
|
pub colours: Colours,
|
|
pub colours: Colours,
|
|
|
|
|
+
|
|
|
|
|
+ /// Whether to show a file type indiccator.
|
|
|
|
|
+ pub classify: bool,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// The **environment** struct contains any data that could change between
|
|
/// The **environment** struct contains any data that could change between
|
|
@@ -303,7 +306,7 @@ impl Details {
|
|
|
for (index, egg) in file_eggs.into_iter().enumerate() {
|
|
for (index, egg) in file_eggs.into_iter().enumerate() {
|
|
|
let mut files = Vec::new();
|
|
let mut files = Vec::new();
|
|
|
let mut errors = egg.errors;
|
|
let mut errors = egg.errors;
|
|
|
- let mut width = DisplayWidth::from(&*egg.file.name);
|
|
|
|
|
|
|
+ let mut width = DisplayWidth::from_file(&egg.file, self.classify);
|
|
|
|
|
|
|
|
if egg.file.dir.is_none() {
|
|
if egg.file.dir.is_none() {
|
|
|
if let Some(parent) = egg.file.path.parent() {
|
|
if let Some(parent) = egg.file.path.parent() {
|
|
@@ -312,7 +315,7 @@ impl Details {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let name = TextCell {
|
|
let name = TextCell {
|
|
|
- contents: filename(&egg.file, &self.colours, true),
|
|
|
|
|
|
|
+ contents: filename(&egg.file, &self.colours, true, self.classify),
|
|
|
width: width,
|
|
width: width,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -453,7 +456,7 @@ impl<'a, U: Users+Groups+'a> Table<'a, U> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
pub fn filename_cell(&self, file: File, links: bool) -> TextCell {
|
|
pub fn filename_cell(&self, file: File, links: bool) -> TextCell {
|
|
|
- let mut width = DisplayWidth::from(&*file.name);
|
|
|
|
|
|
|
+ let mut width = DisplayWidth::from_file(&file, self.opts.classify);
|
|
|
|
|
|
|
|
if file.dir.is_none() {
|
|
if file.dir.is_none() {
|
|
|
if let Some(parent) = file.path.parent() {
|
|
if let Some(parent) = file.path.parent() {
|
|
@@ -462,7 +465,7 @@ impl<'a, U: Users+Groups+'a> Table<'a, U> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
TextCell {
|
|
TextCell {
|
|
|
- contents: filename(&file, &self.opts.colours, links),
|
|
|
|
|
|
|
+ contents: filename(&file, &self.opts.colours, links, self.opts.classify),
|
|
|
width: width,
|
|
width: width,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|