diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-07-22 21:12:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-22 21:12:38 +0200 |
| commit | 91716979e07da18ee026f30c436f5b75bfa3dab9 (patch) | |
| tree | 635a9ccf3a3b9e79374ea04f806407db3bb19692 /default-plugins | |
| parent | docs(changelog): dump screen performance (diff) | |
| download | sl0ppij-91716979e07da18ee026f30c436f5b75bfa3dab9.tar.gz sl0ppij-91716979e07da18ee026f30c436f5b75bfa3dab9.tar.xz sl0ppij-91716979e07da18ee026f30c436f5b75bfa3dab9.zip | |
fix(status-bar): proper truncation of secondary info (#4313)
* fix(status-bar): properly truncate secondary keybindings
* style(fmt): rustfmt
* more correct fix
* fix e2e tests
* docs(changelog): add PR
Diffstat (limited to 'default-plugins')
| -rw-r--r-- | default-plugins/status-bar/src/one_line_ui.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/default-plugins/status-bar/src/one_line_ui.rs b/default-plugins/status-bar/src/one_line_ui.rs index 8ab5687d..564bdc83 100644 --- a/default-plugins/status-bar/src/one_line_ui.rs +++ b/default-plugins/status-bar/src/one_line_ui.rs @@ -980,18 +980,19 @@ fn secondary_keybinds(help: &ModeInfo, tab_info: Option<&TabInfo>, max_len: usiz } if short_line.len <= max_len { short_line - } else { + } else if max_len >= 3 { let part = serialize_text( - &Text::new(format!( - "{:>width$}", - "...", - width = max_len.saturating_sub(3) - )) - .color_range(0, ..) - .opaque(), + &Text::new(format!("{:>width$}", "...", width = max_len)) + .color_range(0, ..) + .opaque(), ); - let len = max_len.saturating_sub(3); + let len = max_len; LinePart { part, len } + } else { + LinePart { + part: "".to_owned(), + len: 0, + } } } } |
