mirror of
https://github.com/Llewellynvdm/exa.git
synced 2025-03-21 08:32:22 +00:00
Colour file names in grid view
This commit is contained in:
parent
728f9f1804
commit
92ccf821ff
@ -72,8 +72,10 @@ fn grid_view(options: &Options, dir: Dir) {
|
||||
|
||||
for y in range(0, files.len() / num_columns) {
|
||||
for x in range(0, num_columns) {
|
||||
let file_name = files.get(y * num_columns + x).name.clone();
|
||||
print!("{}", Left.pad_string(&file_name, max_column_length - strip_formatting(file_name.clone()).len() + 1));
|
||||
let file = files.get(y * num_columns + x);
|
||||
let file_name = file.name.clone();
|
||||
let styled_name = file.file_colour().paint(file_name.as_slice());
|
||||
print!("{}", Left.pad_string(&styled_name, max_column_length - file_name.len() + 1));
|
||||
}
|
||||
print!("\n");
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ impl<'a> File<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn file_colour(&self) -> Style {
|
||||
pub fn file_colour(&self) -> Style {
|
||||
self.get_type().style()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user