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

Method withSelectionBg

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

Source from the content-addressed store, hash-verified

242 this.selectionBgCache.clear()
243 }
244 withSelectionBg(baseId: number): number {
245 const bg = this.selectionBgCode
246 if (bg === null) return this.withInverse(baseId)
247 let id = this.selectionBgCache.get(baseId)
248 if (id === undefined) {
249 // Keep everything except bg (49m) and inverse (27m). Fg, bold, dim,
250 // italic, underline, strikethrough all preserved.
251 const kept = this.get(baseId).filter(
252 c => c.endCode !== '\x1b[49m' && c.endCode !== '\x1b[27m',
253 )
254 kept.push(bg)
255 id = this.intern(kept)
256 this.selectionBgCache.set(baseId, id)
257 }
258 return id
259 }
260}
261
262// endCodes that produce visible effects on space characters

Callers 1

applySelectionOverlayFunction · 0.80

Calls 6

withInverseMethod · 0.95
getMethod · 0.95
internMethod · 0.95
getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected