diff options
author | denis <denismaximov98@gmail.com> | 2021-05-01 13:45:01 +0300 |
---|---|---|
committer | denis <denismaximov98@gmail.com> | 2021-05-01 13:45:01 +0300 |
commit | eabecde90b1617ce4c29be9d5af3f52ccb67e45f (patch) | |
tree | 0d0dafa594269045f084383a9719f2a4995fe7ea /default-plugins/tab-bar | |
parent | a8adfdfd60c73109c5febf470f639862b331ed94 (diff) | |
parent | 325fc5620f07412381dd47dcf7cf9e141a3d66bf (diff) |
chore: painless merge this time
Diffstat (limited to 'default-plugins/tab-bar')
-rw-r--r-- | default-plugins/tab-bar/src/main.rs | 8 | ||||
-rw-r--r-- | default-plugins/tab-bar/src/tab.rs | 13 |
2 files changed, 18 insertions, 3 deletions
diff --git a/default-plugins/tab-bar/src/main.rs b/default-plugins/tab-bar/src/main.rs index 194e11b10..7c6a22209 100644 --- a/default-plugins/tab-bar/src/main.rs +++ b/default-plugins/tab-bar/src/main.rs @@ -54,7 +54,13 @@ impl ZellijPlugin for State { } else if t.active { active_tab_index = t.position; } - let tab = tab_style(tabname, t.active, t.position, self.mode_info.palette); + let tab = tab_style( + tabname, + t.active, + t.position, + t.is_sync_panes_active, + self.mode_info.palette + ); all_tabs.push(tab); } let tab_line = tab_line(all_tabs, active_tab_index, cols, self.mode_info.palette); diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs index e97ecab75..3e3408103 100644 --- a/default-plugins/tab-bar/src/tab.rs +++ b/default-plugins/tab-bar/src/tab.rs @@ -44,12 +44,21 @@ pub fn non_active_tab(text: String, palette: Palette) -> LinePart { } } -pub fn tab_style(text: String, is_active_tab: bool, position: usize, palette: Palette) -> LinePart { - let tab_text = if text.is_empty() { +pub fn tab_style( + text: String, + is_active_tab: bool, + position: usize, + is_sync_panes_active: bool, + palette: Palette +) -> LinePart { + let mut tab_text = if text.is_empty() { format!("Tab #{}", position + 1) } else { text }; + if is_sync_panes_active { + tab_text.push_str(" (Sync)"); + } if is_active_tab { active_tab(tab_text, palette) } else { |