|
|
@ -1765,7 +1765,11 @@ impl Editor {
|
|
|
|
// We need to persist ViewPositions on documents a la PR #7568, then fetch that here.
|
|
|
|
// We need to persist ViewPositions on documents a la PR #7568, then fetch that here.
|
|
|
|
if doc.selections().contains_key(&id) {
|
|
|
|
if doc.selections().contains_key(&id) {
|
|
|
|
if let Some(path) = doc.path() {
|
|
|
|
if let Some(path) = doc.path() {
|
|
|
|
file_locs.push((path.clone(), offset, doc.selection(id).clone()));
|
|
|
|
file_locs.push(FileHistoryEntry::new(
|
|
|
|
|
|
|
|
path.clone(),
|
|
|
|
|
|
|
|
offset,
|
|
|
|
|
|
|
|
doc.selection(id).clone(),
|
|
|
|
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1774,13 +1778,9 @@ impl Editor {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for loc in file_locs {
|
|
|
|
for loc in file_locs {
|
|
|
|
// TODO: can the arg here be a reference? would save cloning
|
|
|
|
persistence::push_file_history(&loc);
|
|
|
|
persistence::push_file_history(FileHistoryEntry::new(
|
|
|
|
self.old_file_locs
|
|
|
|
loc.0.clone(),
|
|
|
|
.insert(loc.path, (loc.view_position, loc.selection));
|
|
|
|
loc.1,
|
|
|
|
|
|
|
|
loc.2.clone(),
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
self.old_file_locs.insert(loc.0, (loc.1, loc.2));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
self.tree.remove(id);
|
|
|
|
self.tree.remove(id);
|
|
|
@ -1820,7 +1820,11 @@ impl Editor {
|
|
|
|
|
|
|
|
|
|
|
|
if view.doc == doc_id {
|
|
|
|
if view.doc == doc_id {
|
|
|
|
if let Some(path) = doc.path() {
|
|
|
|
if let Some(path) = doc.path() {
|
|
|
|
file_locs.push((path.clone(), view.offset, doc.selection(view.id).clone()));
|
|
|
|
file_locs.push(FileHistoryEntry::new(
|
|
|
|
|
|
|
|
path.clone(),
|
|
|
|
|
|
|
|
view.offset,
|
|
|
|
|
|
|
|
doc.selection(view.id).clone(),
|
|
|
|
|
|
|
|
));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// something was previously open in the view, switch to previous doc
|
|
|
|
// something was previously open in the view, switch to previous doc
|
|
|
@ -1837,13 +1841,9 @@ impl Editor {
|
|
|
|
.collect();
|
|
|
|
.collect();
|
|
|
|
|
|
|
|
|
|
|
|
for loc in file_locs {
|
|
|
|
for loc in file_locs {
|
|
|
|
// TODO: can the arg here be a reference? would save cloning
|
|
|
|
persistence::push_file_history(&loc);
|
|
|
|
persistence::push_file_history(FileHistoryEntry::new(
|
|
|
|
self.old_file_locs
|
|
|
|
loc.0.clone(),
|
|
|
|
.insert(loc.path, (loc.view_position, loc.selection));
|
|
|
|
loc.1,
|
|
|
|
|
|
|
|
loc.2.clone(),
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
self.old_file_locs.insert(loc.0, (loc.1, loc.2));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for action in actions {
|
|
|
|
for action in actions {
|
|
|
|