MCPcopy Create free account
hub / github.com/modem-dev/hunk / themeRenderCacheKey

Function themeRenderCacheKey

src/ui/diff/pierre.ts:58–84  ·  view source on GitHub ↗

Build a cache key for theme-dependent terminal colors, not just the stable UI theme id.

(theme: AppTheme)

Source from the content-addressed store, hash-verified

56
57/** Build a cache key for theme-dependent terminal colors, not just the stable UI theme id. */
58function themeRenderCacheKey(theme: AppTheme) {
59 return [
60 theme.id,
61 theme.syntaxTheme ?? "",
62 theme.appearance,
63 theme.background,
64 theme.panelAlt,
65 theme.contextBg,
66 theme.addedBg,
67 theme.removedBg,
68 theme.addedContentBg,
69 theme.removedContentBg,
70 theme.addedSignColor,
71 theme.removedSignColor,
72 theme.syntaxColors.default,
73 theme.syntaxColors.keyword,
74 theme.syntaxColors.string,
75 theme.syntaxColors.comment,
76 theme.syntaxColors.number,
77 theme.syntaxColors.function,
78 theme.syntaxColors.property,
79 theme.syntaxColors.type,
80 theme.syntaxColors.variable ?? "",
81 theme.syntaxColors.operator ?? "",
82 theme.syntaxColors.punctuation,
83 ].join(":");
84}
85
86type HastNode = HastTextNode | HastElementNode;
87

Callers 3

wordDiffHighlightBgFunction · 0.85
flattenHighlightedLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected