Files
neovim/test/functional/api
Volodymyr Chernetskyi e8a0b400d8 fix(statusline): "%.0" renders garbage #41685
Problem:
`getdigits_int(pp, strict, def)` returns `def` only when the number
fails to parse or overflows, never when the text parses to a literal
`0`, so `%.0` leaves `maxwid` at 0. Both render paths then break down:
`l > maxwid` is always true and `while (l >= maxwid)` consumes the whole
string, so `%.0f` comes out as `<` and `%.0l` as `0>3`.

Vim guards for this right after the same call. Nvim had the guard too
until 3344cffe7b ("getdigits: introduce `strict`, `def` parameters"),
which folded it into the new `def` argument and so changed what a
literal zero means. The neighbouring `minwid` call was translated
correctly.

Solution:
Fall back to 50 when the parsed width is not positive, as Vim does.

AI-assisted
2026-09-06 11:24:52 -04:00
..