mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-15 16:57:08 +00:00
Remove space when no file has extended attributes
There would be an extra column, and it looked unsightly. Unsightly! This also removes the last specific style from the details view (Plain).
This commit is contained in:
parent
2594690aff
commit
1bb7a4e47e
@ -10,7 +10,6 @@ use users::{OSUsers, Users};
|
|||||||
use super::filename;
|
use super::filename;
|
||||||
|
|
||||||
use ansi_term::{ANSIString, ANSIStrings, Style};
|
use ansi_term::{ANSIString, ANSIStrings, Style};
|
||||||
use ansi_term::Style::Plain;
|
|
||||||
|
|
||||||
use locale;
|
use locale;
|
||||||
|
|
||||||
@ -215,7 +214,7 @@ impl Table {
|
|||||||
let x_colour = if let f::Type::File = permissions.file_type { c.user_execute_file }
|
let x_colour = if let f::Type::File = permissions.file_type { c.user_execute_file }
|
||||||
else { c.user_execute_other };
|
else { c.user_execute_other };
|
||||||
|
|
||||||
let string = ANSIStrings( &[
|
let mut columns = vec![
|
||||||
file_type,
|
file_type,
|
||||||
bit(permissions.user_read, "r", c.user_read),
|
bit(permissions.user_read, "r", c.user_read),
|
||||||
bit(permissions.user_write, "w", c.user_write),
|
bit(permissions.user_write, "w", c.user_write),
|
||||||
@ -226,12 +225,15 @@ impl Table {
|
|||||||
bit(permissions.other_read, "r", c.other_read),
|
bit(permissions.other_read, "r", c.other_read),
|
||||||
bit(permissions.other_write, "w", c.other_write),
|
bit(permissions.other_write, "w", c.other_write),
|
||||||
bit(permissions.other_execute, "x", c.other_execute),
|
bit(permissions.other_execute, "x", c.other_execute),
|
||||||
if permissions.attribute { c.attribute.paint("@") } else { Plain.paint(" ") },
|
];
|
||||||
]).to_string();
|
|
||||||
|
if permissions.attribute {
|
||||||
|
columns.push(c.attribute.paint("@"));
|
||||||
|
}
|
||||||
|
|
||||||
Cell {
|
Cell {
|
||||||
text: string,
|
text: ANSIStrings(&columns).to_string(),
|
||||||
length: 11,
|
length: columns.len(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user