diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-07 07:42:46 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-07 07:42:46 +0530 |
commit | 141efd025dabd0f94f7b195400900ccb2db9049a (patch) | |
tree | ad9503e984beef7472368b0a04aa8ad430c9ffa0 | |
parent | 6cb2d92aa41e179242bb926b965862d90f06df82 (diff) |
move EntryMarkMap into Mark widget
-rw-r--r-- | src/interactive/app/eventloop.rs | 9 | ||||
-rw-r--r-- | src/interactive/widgets/entries.rs | 4 | ||||
-rw-r--r-- | src/interactive/widgets/mark.rs | 11 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/interactive/app/eventloop.rs b/src/interactive/app/eventloop.rs index 25c6ef2..b7e454c 100644 --- a/src/interactive/app/eventloop.rs +++ b/src/interactive/app/eventloop.rs @@ -8,7 +8,7 @@ use dua::{ WalkOptions, WalkResult, }; use failure::Error; -use std::{collections::BTreeMap, io, path::PathBuf}; +use std::{io, path::PathBuf}; use termion::input::{Keys, TermReadEventsAndRaw}; use tui::backend::Backend; use tui_react::Terminal; @@ -26,13 +26,6 @@ impl Default for FocussedPane { } } -pub type EntryMarkMap = BTreeMap<TreeIndex, EntryMark>; -pub struct EntryMark { - pub size: u64, - pub path: PathBuf, - pub index: usize, -} - #[derive(Default)] pub struct AppState { pub root: TreeIndex, diff --git a/src/interactive/widgets/entries.rs b/src/interactive/widgets/entries.rs index bef91cd..db510de 100644 --- a/src/interactive/widgets/entries.rs +++ b/src/interactive/widgets/entries.rs @@ -1,6 +1,6 @@ use crate::interactive::{ - widgets::{COLOR_MARKED, COLOR_MARKED_DARK, COLOR_MARKED_DARKER}, - DisplayOptions, EntryDataBundle, EntryMarkMap, + widgets::{EntryMarkMap, COLOR_MARKED, COLOR_MARKED_DARK, COLOR_MARKED_DARKER}, + DisplayOptions, EntryDataBundle, }; use dua::traverse::{Tree, TreeIndex}; use itertools::Itertools; diff --git a/src/interactive/widgets/mark.rs b/src/interactive/widgets/mark.rs index 9f94592..be18d0e 100644 --- a/src/interactive/widgets/mark.rs +++ b/src/interactive/widgets/mark.rs @@ -1,8 +1,8 @@ -use crate::interactive::{widgets::COLOR_MARKED_LIGHT, CursorDirection, EntryMark, EntryMarkMap}; +use crate::interactive::{widgets::COLOR_MARKED_LIGHT, CursorDirection}; use dua::traverse::{Tree, TreeIndex}; use dua::{path_of, ByteFormat}; use itertools::Itertools; -use std::borrow::Borrow; +use std::{borrow::Borrow, collections::BTreeMap, path::PathBuf}; use termion::{event::Key, event::Key::*}; use tui::{ buffer::Buffer, @@ -14,6 +14,13 @@ use tui::{ }; use tui_react::{List, ListProps}; +pub type EntryMarkMap = BTreeMap<TreeIndex, EntryMark>; +pub struct EntryMark { + pub size: u64, + pub path: PathBuf, + pub index: usize, +} + #[derive(Default)] pub struct MarkPane { selected: Option<usize>, |