diff options
| author | Yui <yui300127@gmail.com> | 2026-06-03 21:28:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-03 20:28:57 +0200 |
| commit | 0d7246206e7d2110d795e37d80ea14e110912166 (patch) | |
| tree | 1379426cf32e4ec3f3bcb0e95470dc11cab29483 /src | |
| parent | chore(deps): bump uuid from 1.23.1 to 1.23.2 (#265) (diff) | |
| download | sl0pstatus-0d7246206e7d2110d795e37d80ea14e110912166.tar.gz sl0pstatus-0d7246206e7d2110d795e37d80ea14e110912166.tar.xz sl0pstatus-0d7246206e7d2110d795e37d80ea14e110912166.zip | |
feat: add {focused_pane_title} to the tab widget formatter (#250)
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets/tabs.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/widgets/tabs.rs b/src/widgets/tabs.rs index 647cf67..7905742 100644 --- a/src/widgets/tabs.rs +++ b/src/widgets/tabs.rs @@ -294,6 +294,19 @@ impl TabsWidget { ); } + if content.contains("{focused_pane_title}") { + let panes_for_tab: Vec<PaneInfo> = + panes.panes.get(&tab.position).cloned().unwrap_or_default(); + + let focused_pane_title = panes_for_tab + .iter() + .find(|pane| pane.is_focused) + .map(|pane| pane.title.clone()) + .unwrap_or_default(); + + content = content.replace("{focused_pane_title}", &focused_pane_title); + } + content = self.replace_indicators(content, tab, panes); output = format!("{}{}", output, f.format_string(&content)); |
