MCPcopy Index your code
hub / github.com/modem-dev/hunk / setCachedSectionGeometry

Function setCachedSectionGeometry

src/ui/diff/diffSectionGeometry.ts:127–136  ·  view source on GitHub ↗

Store one geometry entry, replacing stale variants for the same slot.

(
  file: DiffFile,
  slot: keyof SectionGeometryCacheSlots,
  cacheKey: string,
  geometry: DiffSectionGeometry,
)

Source from the content-addressed store, hash-verified

125
126/** Store one geometry entry, replacing stale variants for the same slot. */
127function setCachedSectionGeometry(
128 file: DiffFile,
129 slot: keyof SectionGeometryCacheSlots,
130 cacheKey: string,
131 geometry: DiffSectionGeometry,
132) {
133 const cachedByFile = SECTION_GEOMETRY_CACHE.get(file) ?? {};
134 cachedByFile[slot] = { key: cacheKey, geometry };
135 SECTION_GEOMETRY_CACHE.set(file, cachedByFile);
136}
137
138interface DiffSectionRowHeightOptions {
139 layout: Exclude<LayoutMode, "auto">;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected