fix(tabs): do not toggle fullscreen if there are no other panes (#258)

* fix(tabs): do not toggle fullscreen if there are no other panes

* style(fmt): rustfmt
This commit is contained in:
Aram Drevekenin 2021-04-06 17:38:00 +02:00 committed by GitHub
parent e551bec538
commit c827672708
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -634,8 +634,17 @@ impl Tab {
}
});
self.panes_to_hide = pane_ids_to_hide.collect();
let active_terminal = self.panes.get_mut(&active_pane_id).unwrap();
active_terminal.override_size_and_position(expand_to.x, expand_to.y, &expand_to);
if self.panes_to_hide.is_empty() {
// nothing to do, pane is already as fullscreen as it can be, let's bail
return;
} else {
let active_terminal = self.panes.get_mut(&active_pane_id).unwrap();
active_terminal.override_size_and_position(
expand_to.x,
expand_to.y,
&expand_to,
);
}
}
let active_terminal = self.panes.get(&active_pane_id).unwrap();
if let PaneId::Terminal(active_pid) = active_pane_id {