From 58aec1de7589af080683f0bb5a54eda09e31404f Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 3 Apr 2024 12:47:01 +0200 Subject: [PATCH] Do not push invisible local worktrees into recent documents (#10112) Follow-up of https://github.com/zed-industries/zed/pull/9919 that removes invisible worktrees from the list, to avoid things like ![image](https://github.com/zed-industries/zed/assets/2690773/90ce1c29-a1dd-4a03-b09a-effdba620c8f) Release Notes: - N/A --- crates/project/src/project.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 9e1ac82964..cbabda7417 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -6853,10 +6853,12 @@ impl Project { project .update(&mut cx, |project, cx| project.add_worktree(&worktree, cx))?; - cx.update(|cx| { - cx.add_recent_document(&path); - }) - .log_err(); + if visible { + cx.update(|cx| { + cx.add_recent_document(&path); + }) + .log_err(); + } Ok(worktree) }