Files
bat/src
greymoth-jpandClaude Opus 4.8 fa00fb8ce8 fix(list-languages): clamp desired_width to avoid usize underflow at tiny --terminal-width
`get_languages` computed `desired_width = term_width - longest - separator.len()`.
When `--terminal-width` is smaller than the longest language name (e.g. 1), this
underflows `usize`: in overflow-checked builds it panics ("attempt to subtract with
overflow"), and in release it wraps to ~usize::MAX, silently disabling the extension
line-wrapping so `--terminal-width` is ignored for `--list-languages`.

Use `saturating_sub`, mirroring the fix applied to `print_snip` in #3804 (the snip
separator had the same `term_width - ...` underflow pattern). Output at normal widths
is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 17:24:01 +09:00
..
2026-04-20 14:25:49 +02:00
2023-03-14 21:19:14 +01:00
2026-04-27 22:20:33 +03:00
2022-09-04 14:28:44 +02:00
2026-05-06 10:58:02 +02:00
2026-04-20 14:25:49 +02:00
2025-07-15 16:36:58 -07:00
2024-08-18 10:05:37 +02:00
2023-03-03 13:20:03 +01:00
2026-04-20 14:25:49 +02:00
2026-03-03 05:18:49 +02:00