Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pane index when moving panes in same tab #6029

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion mux/src/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ pub trait Domain: Downcast + Send + Sync {
}
};

tab.split_and_insert(pane_index, split_request, Arc::clone(&pane))?;
// pane_index may have changed if src_pane was also in the same tab
let final_pane_index = match tab
.iter_panes_ignoring_zoom()
.iter()
.find(|p| p.pane.pane_id() == pane_id)
{
Some(p) => p.index,
None => anyhow::bail!("invalid pane id {}", pane_id),
};

tab.split_and_insert(final_pane_index, split_request, Arc::clone(&pane))?;
Ok(pane)
}

Expand Down
Loading