Skip to content

Commit

Permalink
zellij-server: screen: Implement active_tab!
Browse files Browse the repository at this point in the history
as a convenience macro that attempts to get the currently active tab. If
the tab is found, it executes a closure (passed by the caller) on this
tab. Otherwise, a standardized error message is printed to the error
log.

This standardizes and deduplicates the loads of:

```
if let Some(active_tab) = screen.get_active_tab_mut(client_id) {
    active_tab.$FUNCTION(...);
} else {
    log::error!("Active tab not found for client id: {:?}", client_id);
}
```

previously present in the code.
  • Loading branch information
har7an committed Jun 3, 2022
1 parent 4b5c63e commit 9c2e0ef
Showing 1 changed file with 115 additions and 243 deletions.
Loading

0 comments on commit 9c2e0ef

Please sign in to comment.