fix(plugins): properly focus pane after tab was closed (#3797)
* fix(plugins): properly focus pane after tab was closed * style(fmt): rustfmt
This commit is contained in:
parent
f58a8891b8
commit
7ef4e82d70
1 changed files with 12 additions and 8 deletions
|
|
@ -2090,15 +2090,16 @@ impl Screen {
|
||||||
.tabs
|
.tabs
|
||||||
.iter()
|
.iter()
|
||||||
.find(|(_tab_index, tab)| tab.has_pane_with_pid(&pane_id))
|
.find(|(_tab_index, tab)| tab.has_pane_with_pid(&pane_id))
|
||||||
.map(|(tab_index, _tab)| *tab_index);
|
.map(|(_tab_index, tab)| tab.position);
|
||||||
match tab_index {
|
match tab_index {
|
||||||
Some(tab_index) => {
|
Some(tab_index) => {
|
||||||
self.go_to_tab(tab_index + 1, client_id)?;
|
self.go_to_tab(tab_index + 1, client_id)?;
|
||||||
self.tabs
|
self.tabs
|
||||||
.get_mut(&tab_index)
|
.iter_mut()
|
||||||
.with_context(err_context)?
|
.find(|(_, t)| t.position == tab_index)
|
||||||
.focus_pane_with_id(pane_id, should_float_if_hidden, client_id)
|
.map(|(_, t)| t.focus_pane_with_id(pane_id, should_float_if_hidden, client_id))
|
||||||
.context("failed to focus pane with id")?;
|
.with_context(err_context)
|
||||||
|
.non_fatal();
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
log::error!("Could not find pane with id: {:?}", pane_id);
|
log::error!("Could not find pane with id: {:?}", pane_id);
|
||||||
|
|
@ -2410,11 +2411,14 @@ impl Screen {
|
||||||
.tabs
|
.tabs
|
||||||
.iter()
|
.iter()
|
||||||
.find(|(_tab_index, tab)| tab.has_pane_with_pid(&pane_id))
|
.find(|(_tab_index, tab)| tab.has_pane_with_pid(&pane_id))
|
||||||
.map(|(tab_index, _tab)| *tab_index);
|
.map(|(_tab_index, tab)| tab.position);
|
||||||
match tab_index {
|
match tab_index {
|
||||||
Some(tab_index) => {
|
Some(tab_index) => {
|
||||||
let tab = self.tabs.get_mut(&tab_index).with_context(err_context)?;
|
if let Some(tab) =
|
||||||
suppress_pane(tab, pane_id, new_pane_id);
|
self.tabs.iter_mut().find(|(_, t)| t.position == tab_index)
|
||||||
|
{
|
||||||
|
suppress_pane(tab.1, pane_id, new_pane_id);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
log::error!("Could not find pane with id: {:?}", pane_id);
|
log::error!("Could not find pane with id: {:?}", pane_id);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue