mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-07 01:56:45 +01:00
more highlights, prevent overscroll
This commit is contained in:
parent
2b855f43d7
commit
b3a52c171b
3 changed files with 61 additions and 31 deletions
|
|
@ -25,6 +25,8 @@ struct Taggart {
|
|||
paths: Vec<Entry>,
|
||||
cursor: usize,
|
||||
offset: usize,
|
||||
column: usize,
|
||||
size: Measure<TuiOut>,
|
||||
}
|
||||
#[derive(Ord, Eq, PartialEq, PartialOrd, Default)]
|
||||
struct Entry {
|
||||
|
|
@ -64,6 +66,11 @@ impl Taggart {
|
|||
}
|
||||
let depth = entry.depth();
|
||||
let path = entry.into_path();
|
||||
let (is_dir, is_mus, is_img) = if path.is_dir() {
|
||||
(true, false, false)
|
||||
} else {
|
||||
(false, false, false)
|
||||
};
|
||||
paths.push(Entry {
|
||||
path: path.strip_prefix(&root)?.into(),
|
||||
is_dir: path.is_dir(),
|
||||
|
|
@ -78,6 +85,8 @@ impl Taggart {
|
|||
paths,
|
||||
cursor: 0,
|
||||
offset: 0,
|
||||
column: 0,
|
||||
size: Measure::new(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue