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