{"version":"2.1.232","anchor":"truncating-text-to-a-zero-or-negative-width-returns-nothing-","canonical_anchor":"truncating-text-to-a-zero-or-negative-width-returns-nothing-","heading":"Truncating text to a zero or negative width returns nothing instead of misbehaving","tier":"notice","area":"Terminal UI","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.232\/e\/truncating-text-to-a-zero-or-negative-width-returns-nothing-","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.232","markdown":"### Truncating text to a zero or negative width returns nothing instead of misbehaving\n\nText truncation at zero width now returns nothing instead of misbehaving.\n\n**What**\n\nThe shared helper that cuts text to a given width now returns an empty string when asked for zero or fewer characters. It previously fell through to slicing and inspecting the character before the cut point.\n\n**Details**\n\n- This matters for fetched page text, where the remaining budget is worked out by subtraction and can come out negative.\n\n**Evidence**\n\n`if (t <= 0) return \"\";`\n\n- Area: Terminal UI\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 0\/5"}