MCPcopy Index your code
hub / github.com/codeaashu/claude-code / withInverse

Method withInverse

src/ink/screen.ts:170–180  ·  view source on GitHub ↗
(baseId: number)

Source from the content-addressed store, hash-verified

168 */
169 private inverseCache = new Map<number, number>()
170 withInverse(baseId: number): number {
171 let id = this.inverseCache.get(baseId)
172 if (id === undefined) {
173 const baseCodes = this.get(baseId)
174 // If already inverted, use as-is (avoids SGR 7 stacking)
175 const hasInverse = baseCodes.some(c => c.endCode === '\x1b[27m')
176 id = hasInverse ? baseId : this.intern([...baseCodes, INVERSE_CODE])
177 this.inverseCache.set(baseId, id)
178 }
179 return id
180 }
181
182 /** Inverse + bold + yellow-bg-via-fg-swap for the CURRENT search match.
183 * OTHER matches are plain inverse — bg inherits from the theme. Current

Callers 2

withSelectionBgMethod · 0.95
applySearchHighlightFunction · 0.80

Calls 4

getMethod · 0.95
internMethod · 0.95
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected