From 0be572e43f8118f6c678a536b3d97d7e976e840f Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 4 Jul 2026 11:35:22 -0500 Subject: fix(theme-studio): persist regexp/doc/negation/warning syntax faces Five syntax categories (rxgb, rxgc, dmark, neg, warn) rendered as editable rows but had no COLS entry, so build_syntax never gave them a SYNTAX slot. They exported nothing and re-imported nothing, so every saved theme dropped them. I added the five to COLS, where the default-face seed fills their real colors and they round-trip through save and import. A regression test now asserts every editable category has a COLS slot. --- scripts/theme-studio/test_generate.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts/theme-studio/test_generate.py') diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py index 0415d04f..ac225ce2 100644 --- a/scripts/theme-studio/test_generate.py +++ b/scripts/theme-studio/test_generate.py @@ -932,5 +932,20 @@ class BespokePreviewFaceCoverage(unittest.TestCase): self.assertEqual(missing, []) +class SyntaxCategoriesPersist(unittest.TestCase): + """Every editable syntax category (CATS) must have a persistable slot. + + build_syntax keys SYNTAX off COLS (plus the specially-added bg), and both + export (dumps SYNTAX) and import (iterates CATS reading d.syntax[k]) rely on + that slot existing. A category in CATS but absent from COLS renders as an + editable row whose value never saves and never re-imports -- the drift that + dropped rxgb/rxgc/dmark/neg/warn from every saved theme.""" + + def test_every_cats_category_has_a_cols_slot(self): + cats = {c[0] for c in generate.CATS} + slots = set(generate.COLS) | {"bg"} + self.assertEqual(cats - slots, set()) + + if __name__ == "__main__": unittest.main() -- cgit v1.2.3