diff options
| author | Brooks Rady <b.j.rady@gmail.com> | 2021-04-28 16:27:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-28 16:27:06 +0100 |
| commit | 3c431ee6254858e5a46fd0870e5aff47f57f64e3 (patch) | |
| tree | fc8bc45e46354debd316c0e88a1194643089014a /default-plugins | |
| parent | docs(changelog): Screen Config File (#399) (diff) | |
| parent | Defining sync keybind using default.yaml (diff) | |
| download | sl0ppij-3c431ee6254858e5a46fd0870e5aff47f57f64e3.tar.gz sl0ppij-3c431ee6254858e5a46fd0870e5aff47f57f64e3.tar.xz sl0ppij-3c431ee6254858e5a46fd0870e5aff47f57f64e3.zip | |
feat(ui): add the ability to synchronize input sent to panes
Diffstat (limited to 'default-plugins')
| -rw-r--r-- | default-plugins/tab-bar/src/main.rs | 2 | ||||
| -rw-r--r-- | default-plugins/tab-bar/src/tab.rs | 13 |
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 5a77ebac..f059d20e 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 a4c7c376..0bc143b7 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 }; |
