Remove panic in recent projects picker
This commit is contained in:
parent
404dd43c30
commit
097a768725
1 changed files with 7 additions and 6 deletions
|
@ -165,12 +165,13 @@ impl PickerDelegate for RecentProjectsView {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn confirm(&mut self, cx: &mut ViewContext<Self>) {
|
fn confirm(&mut self, cx: &mut ViewContext<Self>) {
|
||||||
let selected_match = &self.matches[self.selected_index()];
|
if let Some(selected_match) = &self.matches.get(self.selected_index()) {
|
||||||
let workspace_location = &self.workspace_locations[selected_match.candidate_id];
|
let workspace_location = &self.workspace_locations[selected_match.candidate_id];
|
||||||
cx.dispatch_global_action(OpenPaths {
|
cx.dispatch_global_action(OpenPaths {
|
||||||
paths: workspace_location.paths().as_ref().clone(),
|
paths: workspace_location.paths().as_ref().clone(),
|
||||||
});
|
});
|
||||||
cx.emit(Event::Dismissed);
|
cx.emit(Event::Dismissed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn dismiss(&mut self, cx: &mut ViewContext<Self>) {
|
fn dismiss(&mut self, cx: &mut ViewContext<Self>) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue