Rebind ctrl-` to toggle terminal panel focus

Also, add `ctrl-~` to create new terminals.

Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-05-17 17:35:10 +02:00
parent 747fbfadeb
commit f097444546
5 changed files with 42 additions and 34 deletions

View file

@ -176,6 +176,12 @@ impl Dock {
.map_or(false, |panel| panel.has_focus(cx))
}
pub fn panel_index<T: Panel>(&self) -> Option<usize> {
self.panel_entries
.iter()
.position(|entry| entry.panel.as_any().is::<T>())
}
pub fn active_panel_index(&self) -> usize {
self.active_panel_index
}