(wrapper: HTMLElement, count: number)
| 28 | // O(delta), not O(count) — typing within a line is free once the count |
| 29 | // matches. |
| 30 | export function syncLineNumbersSpans(wrapper: HTMLElement, count: number): void { |
| 31 | let current = wrapper.childElementCount; |
| 32 | while (current < count) { |
| 33 | wrapper.appendChild(wrapper.ownerDocument.createElement('span')); |
| 34 | current++; |
| 35 | } |
| 36 | while (current > count) { |
| 37 | wrapper.lastElementChild!.remove(); |
| 38 | current--; |
| 39 | } |
| 40 | } |
no test coverage detected