diff options
author | Pedro Fedricci <pedromfedricci@gmail.com> | 2023-04-16 11:36:34 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-16 23:36:34 +0900 |
commit | c604780a210d3225b6aaf73642b0b4c583ae5fb9 (patch) | |
tree | f87b4665231e7d2912f74674120447851df394e2 /default-plugins | |
parent | 03c507bc647a692527a66a11cda6ed2c483e0fb4 (diff) |
fix(plugin): respect hide session option on compact-bar (#2368)
Diffstat (limited to 'default-plugins')
-rw-r--r-- | default-plugins/compact-bar/src/line.rs | 6 | ||||
-rw-r--r-- | default-plugins/compact-bar/src/main.rs | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/default-plugins/compact-bar/src/line.rs b/default-plugins/compact-bar/src/line.rs index 6bcbab18a..f1f10eab0 100644 --- a/default-plugins/compact-bar/src/line.rs +++ b/default-plugins/compact-bar/src/line.rs @@ -255,6 +255,7 @@ pub fn tab_line( cols: usize, palette: Palette, capabilities: PluginCapabilities, + hide_session_name: bool, mode: InputMode, active_swap_layout_name: &Option<String>, is_swap_layout_dirty: bool, @@ -266,7 +267,10 @@ pub fn tab_line( } else { tabs_before_active.pop().unwrap() }; - let mut prefix = tab_line_prefix(session_name, mode, palette, cols); + let mut prefix = match hide_session_name { + true => tab_line_prefix(None, mode, palette, cols), + false => tab_line_prefix(session_name, mode, palette, cols), + }; let prefix_len = get_current_title_len(&prefix); // if active tab alone won't fit in cols, don't draw any tabs diff --git a/default-plugins/compact-bar/src/main.rs b/default-plugins/compact-bar/src/main.rs index 71652f0f1..451c3cd8f 100644 --- a/default-plugins/compact-bar/src/main.rs +++ b/default-plugins/compact-bar/src/main.rs @@ -124,6 +124,7 @@ impl ZellijPlugin for State { cols.saturating_sub(1), self.mode_info.style.colors, self.mode_info.capabilities, + self.mode_info.style.hide_session_name, self.mode_info.mode, &active_swap_layout_name, is_swap_layout_dirty, |