fix: display diff totals as plain status text

This commit is contained in:
2026-10-22 19:21:53 +02:00
parent 8f4e0fa7fb
commit ac5c64981d
4 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ Each segment's `title` is a literal template supporting only `{index}`, `{view}`
`margin` adds unstyled space outside both edges of a segment, unlike the styled internal `padding`. `leading_margin` and `trailing_margin` override their respective sides. All accept integers from `0` through `64`; all margins default to zero. Explicit margins are additional to the renderer's one-column separator, so leave them at zero for normal inter-item spacing. Margins count toward anchor placement and collision handling; empty segments consume no margin, and margins yield along with padding and edges when only clipped content fits. `margin` adds unstyled space outside both edges of a segment, unlike the styled internal `padding`. `leading_margin` and `trailing_margin` override their respective sides. All accept integers from `0` through `64`; all margins default to zero. Explicit margins are additional to the renderer's one-column separator, so leave them at zero for normal inter-item spacing. Margins count toward anchor placement and collision handling; empty segments consume no margin, and margins yield along with padding and edges when only clipped content fits.
`padding` adds spaces inside the segment's styling, on both sides of its title, and accepts integers from `0` through `64`. It defaults to `0` for plain-text and custom segments and `1` for tabs, mode, position, battery, diff totals, shell status, and LSP indicators. Internal padding is separate from the inter-item separator; explicit padding can deliberately add more whitespace. `leading_edge` and `trailing_edge` are separate styled glyph strings, not padding; `""` removes an edge. Tabs, diff totals, and shell status default to `"░▓"` / `"▓░"` edges; mode has only the trailing `"▓░"` edge, position and battery only the leading `"░▓"` edge, and other segments have none. `first_leading_edge` optionally overrides the first occurrence's leading glyphs: for tabs this is the actual first tab, not the first tab remaining after clipping; other segments have one occurrence. Tabs default this override to `""`, suppressing the first tab's left fade. Unicode widths are measured in terminal cells. Edge strings must be single-line and contain no control characters. Unknown style keys, invalid templates, and wrong types reject configuration. `padding` adds spaces inside the segment's styling, on both sides of its title, and accepts integers from `0` through `64`. It defaults to `0` for plain-text and custom segments and `1` for tabs, mode, position, battery, shell status, and LSP indicators. Diff totals use plain text without a filled background, padding, or edges by default. Internal padding is separate from the inter-item separator; explicit padding can deliberately add more whitespace. `leading_edge` and `trailing_edge` are separate styled glyph strings, not padding; `""` removes an edge. Tabs and shell status default to `"░▓"` / `"▓░"` edges; mode has only the trailing `"▓░"` edge, position and battery only the leading `"░▓"` edge, and other segments have none. `first_leading_edge` optionally overrides the first occurrence's leading glyphs: for tabs this is the actual first tab, not the first tab remaining after clipping; other segments have one occurrence. Tabs default this override to `""`, suppressing the first tab's left fade. Unicode widths are measured in terminal cells. Edge strings must be single-line and contain no control characters. Unknown style keys, invalid templates, and wrong types reject configuration.
Any other segment name is a custom named value, such as `:build_status`. Set initial strings with `config.labels`; an empty value hides the custom segment, including its title override, margins, padding, and edges. Names match `[A-Za-z_][A-Za-z0-9_]*`. Labels are plain text: control characters are replaced rather than interpreted as terminal escapes. The same named value can appear in either bar. Any other segment name is a custom named value, such as `:build_status`. Set initial strings with `config.labels`; an empty value hides the custom segment, including its title override, margins, padding, and edges. Names match `[A-Za-z_][A-Za-z0-9_]*`. Labels are plain text: control characters are replaced rather than interpreted as terminal escapes. The same named value can appear in either bar.
+3 -3
View File
@@ -195,15 +195,15 @@ impl ChromeLine {
fn default_segment(name: &str) -> SegmentConfig { fn default_segment(name: &str) -> SegmentConfig {
let mut segment = SegmentConfig::default(); let mut segment = SegmentConfig::default();
if matches!(name, "tabs" | "position" | "battery" | "shell" | "diff") { if matches!(name, "tabs" | "position" | "battery" | "shell") {
segment.leading_edge = "░▓".into(); segment.leading_edge = "░▓".into();
} }
if matches!(name, "tabs" | "mode" | "shell" | "diff") { if matches!(name, "tabs" | "mode" | "shell") {
segment.trailing_edge = "▓░".into(); segment.trailing_edge = "▓░".into();
} }
if matches!( if matches!(
name, name,
"tabs" | "mode" | "position" | "battery" | "shell" | "diff" | "lsp" "tabs" | "mode" | "position" | "battery" | "shell" | "lsp"
) { ) {
segment.padding = 1; segment.padding = 1;
} }
+1 -1
View File
@@ -1823,7 +1823,7 @@ fn chrome_items<'a>(
tab: None, tab: None,
accent: !matches!( accent: !matches!(
name.as_str(), name.as_str(),
"path" | "language" | "diagnostics" | "selections" | "count" | "pending" | "buffer" "path" | "language" | "diagnostics" | "selections" | "count" | "pending" | "buffer" | "diff"
), ),
bold: false, bold: false,
first: true, first: true,
-1
View File
@@ -79,7 +79,6 @@ fn omitted_options_inherit_and_explicit_groups_replace_defaults() {
fn both_positions_accept_all_builtins_and_custom_styles() { fn both_positions_accept_all_builtins_and_custom_styles() {
let defaults = ChromeLine::top(); let defaults = ChromeLine::top();
assert_eq!(defaults.right, ["diff", "shell", "battery"]); assert_eq!(defaults.right, ["diff", "shell", "battery"]);
assert_eq!(defaults.segment("diff"), defaults.segment("shell"));
let names = [ let names = [
"tabs", "tabs",
"mode", "mode",