mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
c09f054655
commit
99acd09d26
1 changed files with 21 additions and 8 deletions
|
|
@ -84,19 +84,32 @@ impl Files {
|
||||||
return self.select(path, state);
|
return self.select(path, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut applied = false;
|
match state {
|
||||||
for item in self.iter() {
|
Some(true) => {
|
||||||
todo!();
|
self.selected = self.iter().map(|f| f.path()).collect();
|
||||||
// applied |= self.select(&item.path, state);
|
}
|
||||||
|
Some(false) => {
|
||||||
|
self.selected.clear();
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
for item in &self.items {
|
||||||
|
if self.selected.contains(&item.path) {
|
||||||
|
self.selected.remove(&item.path);
|
||||||
|
} else {
|
||||||
|
self.selected.insert(item.path());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
applied
|
!self.items.is_empty()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn select_index(&mut self, indices: &BTreeSet<usize>, state: Option<bool>) -> bool {
|
pub fn select_index(&mut self, indices: &BTreeSet<usize>, state: Option<bool>) -> bool {
|
||||||
let mut applied = false;
|
let mut applied = false;
|
||||||
for item in self.pick(indices) {
|
let paths: Vec<_> = self.pick(indices).iter().map(|f| f.path()).collect();
|
||||||
todo!();
|
|
||||||
// applied |= self.select(&item.path, state);
|
for path in paths {
|
||||||
|
applied |= self.select(&path, state);
|
||||||
}
|
}
|
||||||
applied
|
applied
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue