( node: DOMElement, pending: number, innerHeight: number, )
| 159 | // Native proportional drain. step = max(MIN, floor(abs*3/4)), capped at |
| 160 | // innerHeight-1 so DECSTBM + blit+shift fast path fire. |
| 161 | function drainProportional( |
| 162 | node: DOMElement, |
| 163 | pending: number, |
| 164 | innerHeight: number, |
| 165 | ): number { |
| 166 | const abs = Math.abs(pending) |
| 167 | const cap = Math.max(1, innerHeight - 1) |
| 168 | const step = Math.min(cap, Math.max(SCROLL_MIN_PER_FRAME, (abs * 3) >> 2)) |
| 169 | if (abs <= step) { |
| 170 | node.pendingScrollDelta = undefined |
| 171 | return pending |
| 172 | } |
| 173 | const applied = pending > 0 ? step : -step |
| 174 | node.pendingScrollDelta = pending - applied |
| 175 | return applied |
| 176 | } |
| 177 | |
| 178 | // OSC 8 hyperlink escape sequences. Empty params (;;) — ansi-tokenize only |
| 179 | // recognizes this exact prefix. The id= param (for grouping wrapped lines) |
no test coverage detected