diff options
| author | Paulo Coelho <9609090+prscoelho@users.noreply.github.com> | 2021-09-09 15:38:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-09 16:38:10 +0200 |
| commit | f2850d2931dddbc3d3ac4f4ac3c656df63bc1ebb (patch) | |
| tree | 271e345fa5651da2461cc6ec3756a1dce6f9d356 /default-plugins/tab-bar/src/tab.rs | |
| parent | docs(changelog): add cmd_exec feature (diff) | |
| download | sl0ppij-f2850d2931dddbc3d3ac4f4ac3c656df63bc1ebb.tar.gz sl0ppij-f2850d2931dddbc3d3ac4f4ac3c656df63bc1ebb.tar.xz sl0ppij-f2850d2931dddbc3d3ac4f4ac3c656df63bc1ebb.zip | |
fix(tab-bar): prevent active tab from being hidden (#703)
Diffstat (limited to 'default-plugins/tab-bar/src/tab.rs')
| -rw-r--r-- | default-plugins/tab-bar/src/tab.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/default-plugins/tab-bar/src/tab.rs b/default-plugins/tab-bar/src/tab.rs index 9edfba13..dfa5ab77 100644 --- a/default-plugins/tab-bar/src/tab.rs +++ b/default-plugins/tab-bar/src/tab.rs @@ -5,7 +5,7 @@ use zellij_tile_utils::style; pub fn active_tab(text: String, palette: Palette, separator: &str) -> LinePart { let left_separator = style!(palette.cyan, palette.green).paint(separator); - let tab_text_len = text.chars().count() + 4; // 2 for left and right separators, 2 for the text padding + let tab_text_len = text.chars().count() + 2 + separator.chars().count() * 2; // 2 for left and right separators, 2 for the text padding let tab_styled_text = style!(palette.black, palette.green) .bold() .paint(format!(" {} ", text)); @@ -22,7 +22,7 @@ pub fn active_tab(text: String, palette: Palette, separator: &str) -> LinePart { pub fn non_active_tab(text: String, palette: Palette, separator: &str) -> LinePart { let left_separator = style!(palette.cyan, palette.fg).paint(separator); - let tab_text_len = text.chars().count() + 4; // 2 for left and right separators, 2 for the padding + let tab_text_len = text.chars().count() + 2 + separator.chars().count() * 2; // 2 for left and right separators, 2 for the text padding let tab_styled_text = style!(palette.black, palette.fg) .bold() .paint(format!(" {} ", text)); |
