From ef20afa9a43fccbbf4fca1bee04d9725373363fb Mon Sep 17 00:00:00 2001 From: CharlesChen0823 Date: Tue, 16 Jul 2024 14:17:58 +0800 Subject: [PATCH] project_panel: Fixed open in split not working in project panel (#14535) Release Notes: - Fixed `cmd-double click` in project panel not opening a split view ([14465](https://github.com/zed-industries/zed/issues/14465)) --- crates/project_panel/src/project_panel.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 994c5f40d2..8f5ff60d6d 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -2171,24 +2171,22 @@ impl ProjectPanel { }); } } else if event.down.modifiers.secondary() { - if !this.marked_entries.insert(selection) { + if event.down.click_count > 1 { + this.split_entry(entry_id, cx); + } else if !this.marked_entries.insert(selection) { this.marked_entries.remove(&selection); } } else if kind.is_dir() { this.toggle_expanded(entry_id, cx); } else { let click_count = event.up.click_count; - if click_count > 1 && event.down.modifiers.secondary() { - this.split_entry(entry_id, cx); - } else { - this.open_entry( - entry_id, - cx.modifiers().secondary(), - click_count > 1, - click_count == 1, - cx, - ); - } + this.open_entry( + entry_id, + cx.modifiers().secondary(), + click_count > 1, + click_count == 1, + cx, + ); } } }))