(cb: any, wait: number)
| 523 | } |
| 524 | |
| 525 | function debounce(cb: any, wait: number) { |
| 526 | let timeout = 0 |
| 527 | return (...args: any) => { |
| 528 | clearTimeout(timeout) |
| 529 | timeout = window.setTimeout(() => cb(...args), wait) |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | function findPadding(text: string): [string, number, number] { |
| 534 | // Find beginning of previous line. |