From ca03d871a6bb9d625408f77ddb3c7c7f1bc1593c Mon Sep 17 00:00:00 2001 From: Joseph Lyons Date: Tue, 7 Mar 2023 15:09:06 -0500 Subject: [PATCH] Add a separator between the New Terminal button and existing terminal buttons --- crates/workspace/src/terminal_button.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/workspace/src/terminal_button.rs b/crates/workspace/src/terminal_button.rs index 0e21f51341..69914fe6ce 100644 --- a/crates/workspace/src/terminal_button.rs +++ b/crates/workspace/src/terminal_button.rs @@ -119,12 +119,17 @@ impl TerminalButton { let project = workspace.read(cx).project().read(cx); let local_terminal_handles = project.local_terminal_handles(); + if !local_terminal_handles.is_empty() { + menu_options.push(ContextMenuItem::Separator) + } + for local_terminal_handle in local_terminal_handles { if let Some(terminal) = local_terminal_handle.upgrade(cx) { - let title = terminal.read(cx).title(); - // TODO: Replace the `NewTerminal` action with an action that instead focuses the selected terminal - menu_options.push(ContextMenuItem::item(title, NewTerminal)) + menu_options.push(ContextMenuItem::item( + terminal.read(cx).title(), + NewTerminal, + )) } } }