Add terminal::Toggle (#37585)
Co-Authored-By: Brandan <b5@n0.computer> Release Notes: - Added a new action `terminal::Toggle` that is by default bound to 'ctrl-\`'. This copies the default behaviour from VSCode and Jetbrains where the terminal opens and closes correctly. If you'd like the old behaviour you can rebind 'ctrl-\`' to `terminal::ToggleFocus` Co-authored-by: Brandan <b5@n0.computer>
This commit is contained in:
@@ -3093,6 +3093,16 @@ impl Workspace {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn close_panel<T: Panel>(&self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
for dock in self.all_docks().iter() {
|
||||
dock.update(cx, |dock, cx| {
|
||||
if dock.panel::<T>().is_some() {
|
||||
dock.set_open(false, window, cx)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub fn panel<T: Panel>(&self, cx: &App) -> Option<Entity<T>> {
|
||||
self.all_docks()
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user