kitty/tools/utils/style
Kovid Goyal d6f038691c
Parse SGR codes when wrapping text exactly as kitty does
Port the CSI tokenizer and SGR grouping logic from vt-parser.c and
cursor.c so that empty parameters terminated by a semicolon are treated
as zero everywhere, not only in extended colors. This fixes stale
attributes being re-applied on wrapped lines for codes such as ;m, ;31m
and 4:;31m. Also match kitty for codes with invalid characters or
private/intermediate bytes (ignored entirely), misplaced sub-parameters,
mixed colon/semicolon colors, out of range color indices, SGR 21 and
clamped underline styles.

Closes #10895
2026-11-19 09:03:09 +05:30
..
api.go
colorspaces.go More cleanups for color parsing 2025-12-31 09:35:09 +05:30
colorspaces_bench_test.go Modernize Go code 2026-03-21 08:41:47 +05:30
colorspaces_test.go More cleanups for color parsing 2025-12-31 09:35:09 +05:30
indent-and-wrap.go Parse SGR codes when wrapping text exactly as kitty does 2026-11-19 09:03:09 +05:30
indent-and-wrap_test.go Parse SGR codes when wrapping text exactly as kitty does 2026-11-19 09:03:09 +05:30
wrapper.go More cleanups for color parsing 2025-12-31 09:35:09 +05:30
wrapper_test.go More cleanups for color parsing 2025-12-31 09:35:09 +05:30