(baseId: number)
| 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 |
no test coverage detected