Preserve selections through external changes, part of #500

This commit is contained in:
Jeremy Soller 2024-09-25 16:06:11 -06:00
parent b91088482b
commit 03b6b6bb45
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 27 additions and 8 deletions

View file

@ -609,13 +609,9 @@ impl App {
let mut paths = Vec::new();
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
if let Some(tab) = self.tab_model.data::<Tab>(entity) {
if let Some(ref items) = tab.items_opt() {
for item in items.iter() {
if item.selected {
if let Some(Location::Path(path)) = &item.location_opt {
paths.push(path.clone());
}
}
for location in tab.selected_locations() {
if let Some(path) = location.path_opt() {
paths.push(path.to_path_buf());
}
}
}