From bc2f3668a662462af703aa051e7cddae58e0b4dc Mon Sep 17 00:00:00 2001 From: Greg Kuruc Date: Wed, 14 Aug 2024 17:00:25 -0400 Subject: [PATCH] fix: add short circuit to set active pane --- mux/src/tab.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mux/src/tab.rs b/mux/src/tab.rs index 8eec504fb5f..03d48f159c0 100644 --- a/mux/src/tab.rs +++ b/mux/src/tab.rs @@ -1748,6 +1748,12 @@ impl TabInner { } fn set_active_pane(&mut self, pane: &Arc) { + let prior = self.get_active_pane(); + + if is_pane(pane, &prior.as_ref()) { + return; + } + if self.zoomed.is_some() { if !configuration().unzoom_on_switch_pane { return; @@ -1760,7 +1766,6 @@ impl TabInner { .iter() .find(|p| p.pane.pane_id() == pane.pane_id()) { - let prior = self.get_active_pane(); self.active = item.index; self.recency.tag(item.index); self.advise_focus_change(prior);