recent_project: Fix overflow sub (#15965)
close: #15783 Release Notes: - Fixed a potential panic that can occur when deleting entries from the recent-projects menu ([#15783](https://github.com/zed-industries/zed/issues/15783))
This commit is contained in:
parent
73fb8277fc
commit
a71bfd41cc
1 changed files with 1 additions and 1 deletions
|
@ -669,7 +669,7 @@ impl RecentProjectsDelegate {
|
|||
.unwrap_or_default();
|
||||
this.update(&mut cx, move |picker, cx| {
|
||||
picker.delegate.set_workspaces(workspaces);
|
||||
picker.delegate.set_selected_index(ix - 1, cx);
|
||||
picker.delegate.set_selected_index(ix.saturating_sub(1), cx);
|
||||
picker.delegate.reset_selected_match_index = false;
|
||||
picker.update_matches(picker.query(cx), cx)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue