diff options
| author | Aram Drevekenin <aram@poor.dev> | 2026-02-19 11:38:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-19 11:38:02 +0100 |
| commit | b0584cae42ac61212e8b5d5d7be6a5b369b842b3 (patch) | |
| tree | 01fcfb6ffd6db2c10659f626cf7e0bc6d5aac146 /default-plugins | |
| parent | Fix multi pane breakout (#4726) (diff) | |
| download | sl0ppij-b0584cae42ac61212e8b5d5d7be6a5b369b842b3.tar.gz sl0ppij-b0584cae42ac61212e8b5d5d7be6a5b369b842b3.tar.xz sl0ppij-b0584cae42ac61212e8b5d5d7be6a5b369b842b3.zip | |
fix: tab-bar wrapping for extremely small widths (#4728)
* fix: tab-bar wrapping for extremely small widths
* add pr
Diffstat (limited to 'default-plugins')
| -rw-r--r-- | default-plugins/tab-bar/src/line.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/default-plugins/tab-bar/src/line.rs b/default-plugins/tab-bar/src/line.rs index e7a26b98..aa76ce27 100644 --- a/default-plugins/tab-bar/src/line.rs +++ b/default-plugins/tab-bar/src/line.rs @@ -250,8 +250,14 @@ pub fn tab_line( }) }; - let non_tab_len = - get_current_title_len(&prefix) + swap_layout_indicator.as_ref().map(|s| s.len).unwrap_or(0); + // Drop indicator if it would cause wrapping (active tab always rendered unconditionally) + let prefix_len = get_current_title_len(&prefix); + let indicator_len = swap_layout_indicator.as_ref().map(|s| s.len).unwrap_or(0); + if indicator_len > 0 && prefix_len + active_tab.len + indicator_len > cols { + swap_layout_indicator = None; + } + + let non_tab_len = prefix_len + swap_layout_indicator.as_ref().map(|s| s.len).unwrap_or(0); let mut tabs_to_render = vec![active_tab]; |
