1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 04:56:12 +03:00

check the zoom state before unzooming

This commit is contained in:
Quan Tong 2023-08-29 10:10:38 +07:00 committed by Wez Furlong
parent 8f845f9b47
commit f4db68637d

View File

@ -532,10 +532,23 @@ impl SessionHandler {
let tab = mux
.get_tab(containing_tab_id)
.ok_or_else(|| anyhow!("no such tab {}", containing_tab_id))?;
tab.set_zoomed(false);
if zoomed {
tab.set_active_pane(&pane);
tab.set_zoomed(zoomed);
match tab.get_zoomed_pane() {
Some(p) => {
let is_zoomed = p.pane_id() == pane_id;
if is_zoomed != zoomed {
tab.set_zoomed(false);
if zoomed {
tab.set_active_pane(&pane);
tab.set_zoomed(zoomed);
}
}
}
None => {
if zoomed {
tab.set_active_pane(&pane);
tab.set_zoomed(zoomed);
}
}
}
Ok(Pdu::UnitResponse(UnitResponse {}))
},