Documentation
¶
Overview ¶
Package textutil holds text-shaping helpers shared by jade's response builders.
Index ¶
Constants ¶
const ClampHeadFraction = 0.4
ClampHeadFraction splits a clamp budget between the start and end of the text. Both ends matter for tool output: compilers report the first failure first, `go test` prints its FAIL summary last, and a diff's first and last hunks are equally likely to be the interesting one — so keeping only one end reliably loses the decisive part for some caller.
Variables ¶
This section is empty.
Functions ¶
func Clamp ¶
Clamp bounds text to maxBytes, keeping the head and the tail and replacing the middle with an explicit marker naming what was dropped. It returns the clamped text and the number of bytes omitted (0 when nothing was cut).
Cuts land on line boundaries wherever possible: a raw byte cut can split a UTF-8 rune or leave a half-written path, which costs a reader more than the few bytes it saves.
Truncation is always visible. A reader who cannot see that bytes are missing will read the remainder as complete, which is a worse failure than returning less.
Types ¶
This section is empty.