Skip to content

Commit

Permalink
Make the code from the previous commit less terrible
Browse files Browse the repository at this point in the history
  • Loading branch information
white-axe committed Oct 22, 2023
1 parent 5a16a73 commit 1b968ca
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/tabs/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,10 @@ where
is_empty = false;
}

// Check if the originally focused tab is inside this tree
if let Some(k) = focused_id.and_then(|id| {
tabs.iter().enumerate().find_map(|(i, tab)| {
if tab.id() == id {
Some(i)
} else {
None
}
})
}) {
// Check if the originally focused tab is inside this node
if let Some((k, _)) = focused_id
.and_then(|id| tabs.iter().enumerate().find(|(_, tab)| tab.id() == id))
{
active_tab = Some((i, j, k));
}
}
Expand Down

0 comments on commit 1b968ca

Please sign in to comment.