aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins
diff options
context:
space:
mode:
authordenis <denismaximov98@gmail.com>2021-05-01 13:45:01 +0300
committerdenis <denismaximov98@gmail.com>2021-05-01 13:45:01 +0300
commiteabecde90b1617ce4c29be9d5af3f52ccb67e45f (patch)
tree0d0dafa594269045f084383a9719f2a4995fe7ea /default-plugins
parentwip: more cleaning up (diff)
parentdocs(changelog): performance improvements (diff)
downloadsl0ppij-eabecde90b1617ce4c29be9d5af3f52ccb67e45f.tar.gz
sl0ppij-eabecde90b1617ce4c29be9d5af3f52ccb67e45f.tar.xz
sl0ppij-eabecde90b1617ce4c29be9d5af3f52ccb67e45f.zip
chore: painless merge this time
Diffstat (limited to 'default-plugins')
-rw-r--r--default-plugins/tab-bar/src/main.rs8
-rw-r--r--default-plugins/tab-bar/src/tab.rs13
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 194e11b1..7c6a2220 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 e97ecab7..3e340810 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 {