Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 141efd0

Browse files
author
Sebastian Thiel
committed
move EntryMarkMap into Mark widget
1 parent 6cb2d92 commit 141efd0

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/interactive/app/eventloop.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use dua::{
88
WalkOptions, WalkResult,
99
};
1010
use failure::Error;
11-
use std::{collections::BTreeMap, io, path::PathBuf};
11+
use std::{io, path::PathBuf};
1212
use termion::input::{Keys, TermReadEventsAndRaw};
1313
use tui::backend::Backend;
1414
use tui_react::Terminal;
@@ -26,13 +26,6 @@ impl Default for FocussedPane {
2626
}
2727
}
2828

29-
pub type EntryMarkMap = BTreeMap<TreeIndex, EntryMark>;
30-
pub struct EntryMark {
31-
pub size: u64,
32-
pub path: PathBuf,
33-
pub index: usize,
34-
}
35-
3629
#[derive(Default)]
3730
pub struct AppState {
3831
pub root: TreeIndex,

src/interactive/widgets/entries.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::interactive::{
2-
widgets::{COLOR_MARKED, COLOR_MARKED_DARK, COLOR_MARKED_DARKER},
3-
DisplayOptions, EntryDataBundle, EntryMarkMap,
2+
widgets::{EntryMarkMap, COLOR_MARKED, COLOR_MARKED_DARK, COLOR_MARKED_DARKER},
3+
DisplayOptions, EntryDataBundle,
44
};
55
use dua::traverse::{Tree, TreeIndex};
66
use itertools::Itertools;

src/interactive/widgets/mark.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::interactive::{widgets::COLOR_MARKED_LIGHT, CursorDirection, EntryMark, EntryMarkMap};
1+
use crate::interactive::{widgets::COLOR_MARKED_LIGHT, CursorDirection};
22
use dua::traverse::{Tree, TreeIndex};
33
use dua::{path_of, ByteFormat};
44
use itertools::Itertools;
5-
use std::borrow::Borrow;
5+
use std::{borrow::Borrow, collections::BTreeMap, path::PathBuf};
66
use termion::{event::Key, event::Key::*};
77
use tui::{
88
buffer::Buffer,
@@ -14,6 +14,13 @@ use tui::{
1414
};
1515
use tui_react::{List, ListProps};
1616

17+
pub type EntryMarkMap = BTreeMap<TreeIndex, EntryMark>;
18+
pub struct EntryMark {
19+
pub size: u64,
20+
pub path: PathBuf,
21+
pub index: usize,
22+
}
23+
1724
#[derive(Default)]
1825
pub struct MarkPane {
1926
selected: Option<usize>,

0 commit comments

Comments
 (0)