Skip to content

Commit

Permalink
check the zoom state before unzooming
Browse files Browse the repository at this point in the history
  • Loading branch information
quantonganh authored and wez committed Aug 29, 2023
1 parent 8f845f9 commit f4db686
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions wezterm-mux-server-impl/src/sessionhandler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}))
},
Expand Down

0 comments on commit f4db686

Please sign in to comment.