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 committed Aug 29, 2023
1 parent 336ebbf commit 1819a7d
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 1819a7d

Please sign in to comment.