updated ui temporarily to fix a bug, will add a seperate TUI

This commit is contained in:
sreedev
2023-01-04 11:38:41 -05:00
parent b46dc9bf15
commit ee50d1133c
2 changed files with 13 additions and 7 deletions

View File

@@ -7,7 +7,14 @@ use std::{collections::HashMap, fs};
use crate::params::Params;
fn format_path(path: &String, opts: &Params) -> String {
format!("...{}", path.replace(&opts.get_directory().unwrap(), ""))
let display_path = path.replace(&opts.get_directory().unwrap(), "");
let display_range = if display_path.len() > 32 {
&display_path[(display_path.len() - 32)..]
} else {
&display_path[..]
};
format!("...{}", display_range)
}
fn file_size(path: &String) -> String {