(baseId: number)
| 196 | */ |
| 197 | private inverseCache = new Map<number, number>() |
| 198 | withInverse(baseId: number): number { |
| 199 | let id = this.inverseCache.get(baseId) |
| 200 | if (id === undefined) { |
| 201 | const baseCodes = this.get(baseId) |
| 202 | // If already inverted, use as-is (avoids SGR 7 stacking) |
| 203 | const hasInverse = baseCodes.some(c => c.endCode === '\x1b[27m') |
| 204 | id = hasInverse ? baseId : this.intern([...baseCodes, INVERSE_CODE]) |
| 205 | this.inverseCache.set(baseId, id) |
| 206 | } |
| 207 | return id |
| 208 | } |
| 209 | |
| 210 | /** Inverse + bold + yellow-bg-via-fg-swap for the CURRENT search match. |
| 211 | * OTHER matches are plain inverse — bg inherits from the theme. Current |
no test coverage detected