From a5a4246e6ce50bec21f2a1bfe378a2d576dbbe1b Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 14 Jun 2022 14:01:49 +0200 Subject: [PATCH] Attempt to open new entry only if it is a file --- crates/project_panel/src/project_panel.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index bbd64efe17..895d17354c 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -410,6 +410,7 @@ impl ProjectPanel { let worktree_id = edit_state.worktree_id; let is_new_entry = edit_state.is_new_entry; + let is_dir = edit_state.is_dir; let worktree = self.project.read(cx).worktree_for_id(worktree_id, cx)?; let entry = worktree.read(cx).entry_for_id(edit_state.entry_id)?.clone(); let filename = self.filename_editor.read(cx).text(cx); @@ -458,7 +459,7 @@ impl ProjectPanel { } } this.update_visible_entries(None, cx); - if is_new_entry { + if is_new_entry && !is_dir { this.open_entry( &Open { entry_id: new_entry.id,