diff options
author | rabite <rabite@posteo.de> | 2019-04-04 00:31:01 +0200 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-04-04 00:31:01 +0200 |
commit | d5ccfb0d7403bea77e027a9ca930c81bed5a2314 (patch) | |
tree | 897dce30b7909b4267cfe79bc256c3d16545f47a /src/files.rs | |
parent | 343dd6dedabb1fc5158677fced8588e5b9a00c05 (diff) |
show fs space usage and too much other stuff
Diffstat (limited to 'src/files.rs')
-rw-r--r-- | src/files.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/files.rs b/src/files.rs index b3c13e4..637b99a 100644 --- a/src/files.rs +++ b/src/files.rs @@ -329,8 +329,21 @@ impl Files { pub fn replace_file(&mut self, old: Option<&File>, new: Option<File>) -> HResult<()> { + let (tag, selected) = if let Some(old) = old { + if let Some(old) = self.find_file_with_path(&old.path) { + (old.tag, old.selected) + } else { + (None, false) + } + } else { + (None, false) + }; old.map(|old| self.files.remove_item(old)); - new.map(|new| self.files.push(new)); + new.map(|mut new| { + new.tag = tag; + new.selected = selected; + self.files.push(new); + }); self.sort(); Ok(()) } @@ -913,7 +926,7 @@ impl File { if file_user.name() == cur_user { crate::term::color_green() } else { - crate::term::color_yellow() }; + crate::term::color_red() }; Some(format!("{}{}", color, file_user.name().to_string_lossy())) } @@ -926,7 +939,7 @@ impl File { if file_group.name() == cur_group { crate::term::color_green() } else { - crate::term::color_yellow() }; + crate::term::color_red() }; Some(format!("{}{}", color, file_group.name().to_string_lossy())) } |