mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Display: No padding if no bars drawn
If not drawing the percent bars do not add padding to the filenames https://github.com/bootandy/dust/issues/89
This commit is contained in:
+8
-7
@@ -285,15 +285,16 @@ pub fn format_string(
|
||||
let name = get_printable_name(&node.name, display_data.short_paths);
|
||||
let width = get_unicode_width_of_indent_and_name(indent, &name);
|
||||
|
||||
let name_and_padding = name
|
||||
+ &(repeat(" ")
|
||||
.take(display_data.longest_string_length - width)
|
||||
.collect::<String>());
|
||||
let (percents, name_and_padding) = if percent_bar != "" {
|
||||
let percents = format!("│{} │ {:>4}", percent_bar, percent_size_str);
|
||||
|
||||
let percents = if percent_bar != "" {
|
||||
format!("│{} │ {:>4}", percent_bar, percent_size_str)
|
||||
let name_and_padding = name
|
||||
+ &(repeat(" ")
|
||||
.take(display_data.longest_string_length - width)
|
||||
.collect::<String>());
|
||||
(percents, name_and_padding)
|
||||
} else {
|
||||
"".into()
|
||||
("".into(), name)
|
||||
};
|
||||
|
||||
let pretty_size = if is_biggest && display_data.colors_on {
|
||||
|
||||
Reference in New Issue
Block a user