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:
CharlesChen0823 authored and GitHub committed 2024-08-08 15:58:59 +02:00
1 parent e7ace39aca
commit a192042d34
1 file changed
+1 -1
@@ -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)
})