diff options
| author | Brooks Rady <b.j.rady@gmail.com> | 2021-04-29 15:56:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-29 15:56:15 +0100 |
| commit | 20649643ded709294e2c12aef59bef9896a5291c (patch) | |
| tree | a90d990ec7e995fb74e7f52663a65df94e42e4fd | |
| parent | fix(build): don't store binary assets in git (diff) | |
| parent | Style fix (diff) | |
| download | sl0ppij-20649643ded709294e2c12aef59bef9896a5291c.tar.gz sl0ppij-20649643ded709294e2c12aef59bef9896a5291c.tar.xz sl0ppij-20649643ded709294e2c12aef59bef9896a5291c.zip | |
fix(ui): fix the tab '(Sync)' suffix
| -rw-r--r-- | default-plugins/tab-bar/src/tab.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs index 0bc143b7..6c52e629 100644 --- a/default-plugins/tab-bar/src/tab.rs +++ b/default-plugins/tab-bar/src/tab.rs @@ -46,15 +46,14 @@ pub fn tab_style( 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, sync_text) + 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) } else { |
