1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 06:54:45 +03:00

window:active_key_table now includes per-pane stacks

refs: https://github.com/wez/wezterm/discussions/2986
This commit is contained in:
Wez Furlong 2023-01-20 07:03:19 -07:00
parent 9a76a54081
commit 59b609f592
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387
2 changed files with 22 additions and 1 deletions

View File

@ -77,6 +77,9 @@ As features stabilize some brief notes about them will accumulate here.
[#2977](https://github.com/wez/wezterm/pull/2977)
* mux: `default_workspace` was not always respected when spawning
[#2981](https://github.com/wez/wezterm/issues/2981)
* [window:active_key_table()](config/lua/window/active_key_table.md) now
factors in pane-specific key table stacks for things like `CopyMode`.
[#2986](https://github.com/wez/wezterm/discussions/2986)
#### Changed
* `CTRL-SHIFT-P` now activates the new command palette, instead of `PaneSelect`

View File

@ -524,7 +524,25 @@ impl super::TermWindow {
}
pub fn current_key_table_name(&mut self) -> Option<String> {
let name = self.key_table_state.current_table().map(|s| s.to_string());
let mut name = None;
if let Some(pane) = self.get_active_pane_or_overlay() {
if let Some(overlay) = self.pane_state(pane.pane_id()).overlay.as_mut() {
name = overlay
.key_table_state
.current_table()
.map(|s| s.to_string());
if let Some(entry) = overlay.key_table_state.stack.last() {
if let Some(expiry) = entry.expiration {
self.update_next_frame_time(Some(expiry));
}
}
}
}
if name.is_none() {
name = self.key_table_state.current_table().map(|s| s.to_string());
}
if let Some(entry) = self.key_table_state.stack.last() {
if let Some(expiry) = entry.expiration {
self.update_next_frame_time(Some(expiry));