1
1
mirror of https://github.com/wez/wezterm.git synced 2024-10-27 08:09:45 +03:00

un-zoom/re-zoom around PaneSelect

refs: https://github.com/wez/wezterm/issues/3573
This commit is contained in:
Wez Furlong 2023-04-20 21:48:37 -07:00
parent e771fa4c5e
commit 70d809fa88
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
2 changed files with 17 additions and 0 deletions

View File

@ -30,6 +30,8 @@ As features stabilize some brief notes about them will accumulate here.
[tiling_desktop_environments](config/lua/config/tiling_desktop_environments.md).
* Added eigth block corner glyphs to custom block glyphs. Thanks to @joouha! #3559
* Don't hide mouse cursor when pressing only modifier keys. #3570
* [PaneSelect](config/lua/keyassignment/PaneSelect.md) will now un-zoom to show
all panes, then re-zoom after performing its action. #3573
#### New

View File

@ -19,6 +19,7 @@ pub struct PaneSelector {
selection: RefCell<String>,
alphabet: String,
mode: PaneSelectMode,
was_zoomed: bool,
}
impl PaneSelector {
@ -28,12 +29,22 @@ impl PaneSelector {
} else {
args.alphabet.clone()
};
// Ensure that we are un-zoomed and remember the original state
let was_zoomed = {
let mux = Mux::get();
mux.get_active_tab_for_window(term_window.mux_window_id)
.map(|tab| tab.set_zoomed(false))
.unwrap_or(false)
};
Self {
element: RefCell::new(None),
labels: RefCell::new(vec![]),
selection: RefCell::new(String::new()),
alphabet,
mode: args.mode,
was_zoomed,
}
}
@ -167,6 +178,10 @@ impl PaneSelector {
}
}
if self.was_zoomed {
tab.set_zoomed(true);
}
term_window.cancel_modal();
Ok(())
}