diff options
author | Canop <cano.petrole@gmail.com> | 2020-12-13 16:41:35 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-12-13 17:22:07 +0100 |
commit | 2c06c7ca0a580618d932325e15d8d40e7640f24d (patch) | |
tree | 5764d009d564a514a285426be6ce497cc65660c9 /src/filesystems/mount_space_display.rs | |
parent | ee4f93f4919be4e716bb9b73476473bbc8bd7159 (diff) |
keep selection visible on unfiltering
The selection was sometimes scrolled away on unfiltering.
Also change some formatting.
Diffstat (limited to 'src/filesystems/mount_space_display.rs')
-rw-r--r-- | src/filesystems/mount_space_display.rs | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/filesystems/mount_space_display.rs b/src/filesystems/mount_space_display.rs index 9878af7..ec914b6 100644 --- a/src/filesystems/mount_space_display.rs +++ b/src/filesystems/mount_space_display.rs @@ -9,12 +9,8 @@ use { style::{ResetColor, SetBackgroundColor, SetForegroundColor}, QueueableCommand, }, - lfs_core::{ - Mount, - }, - termimad::{ - ProgressBar, - }, + lfs_core::Mount, + termimad::ProgressBar, }; /// an abstract of the space info relative to a block device. @@ -101,7 +97,7 @@ impl<'m, 's> MountSpaceDisplay<'m, 's> { if let Some(bg_color) = bg { cw.w.queue(SetBackgroundColor(bg_color))?; } else { - cw.w.queue(ResetColor{})?; + cw.w.queue(ResetColor {})?; } cw.w.queue(SetForegroundColor(share_color))?; cw.queue_unstyled_char(' ')?; @@ -113,19 +109,19 @@ impl<'m, 's> MountSpaceDisplay<'m, 's> { if let Some(bg_color) = bg { cw.w.queue(SetBackgroundColor(bg_color))?; } else { - cw.w.queue(ResetColor{})?; + cw.w.queue(ResetColor {})?; } cw.queue_unstyled_char(' ')?; cw.w.queue(SetBackgroundColor(share_color))?; - cw.queue_unstyled_g_string(format!("{:<width$}", pb, width=w_bar))?; + cw.queue_unstyled_g_string(format!("{:<width$}", pb, width = w_bar))?; } if let Some(bg_color) = bg { cw.w.queue(SetBackgroundColor(bg_color))?; } else { - cw.w.queue(ResetColor{})?; + cw.w.queue(ResetColor {})?; } cw.w.queue(SetForegroundColor(share_color))?; - cw.queue_unstyled_g_string(format!("{:>3.0}%", 100.0*s.use_share()))?; + cw.queue_unstyled_g_string(format!("{:>3.0}%", 100.0 * s.use_share()))?; } else { // there's not much to print if there's no size info cw.queue_g_string(&txt_style, format!(" {}", &self.mount.info.fs))?; |