summaryrefslogtreecommitdiffstats
path: root/default-plugins/tab-bar
diff options
context:
space:
mode:
authorDante Pippi <6619666+dantepippi@users.noreply.github.com>2021-04-27 15:56:42 -0300
committerDante Pippi <6619666+dantepippi@users.noreply.github.com>2021-04-28 11:16:06 -0300
commit62662464e3814bde666ec826850c9d87d4af2639 (patch)
tree5b77ff014c756e78ed9850a25cdb78714b570758 /default-plugins/tab-bar
parent6769627c3677e22a69b9059b1d85b00bd0d29bbb (diff)
Including text on tab name to let users know sync is on.
Diffstat (limited to 'default-plugins/tab-bar')
-rw-r--r--default-plugins/tab-bar/src/main.rs2
-rw-r--r--default-plugins/tab-bar/src/tab.rs13
2 files changed, 12 insertions, 3 deletions
diff --git a/default-plugins/tab-bar/src/main.rs b/default-plugins/tab-bar/src/main.rs
index 5a77ebaca..f059d20ef 100644
--- a/default-plugins/tab-bar/src/main.rs
+++ b/default-plugins/tab-bar/src/main.rs
@@ -65,7 +65,7 @@ impl ZellijPlugin for State {
} else if t.active {
active_tab_index = t.position;
}
- let tab = tab_style(tabname, t.active, t.position);
+ let tab = tab_style(tabname, t.active, t.position, t.is_sync_panes_active);
all_tabs.push(tab);
}
let tab_line = tab_line(all_tabs, active_tab_index, cols);
diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs
index a4c7c3762..0bc143b7a 100644
--- a/default-plugins/tab-bar/src/tab.rs
+++ b/default-plugins/tab-bar/src/tab.rs
@@ -40,9 +40,18 @@ pub fn non_active_tab(text: String) -> LinePart {
}
}
-pub fn tab_style(text: String, is_active_tab: bool, position: usize) -> LinePart {
+pub fn tab_style(
+ text: String,
+ is_active_tab: bool,
+ position: usize,
+ is_sync_panes_active: bool,
+) -> LinePart {
+ let sync_text = match is_sync_panes_active {
+ true => " (Sync)".to_string(),
+ false => "".to_string(),
+ };
let tab_text = if text.is_empty() {
- format!("Tab #{}", position + 1)
+ format!("Tab #{}{}", position + 1, sync_text)
} else {
text
};