* Character class for double-click word-expansion. Cells with the same * class as the clicked cell are included in the selection; a class change * is a boundary. Matches typical terminal-emulator behavior (iTerm2 etc.): * double-click on `foo` selects `foo`, on `->` selects `->`, on spaces * sel
(c: string)
| 149 | * selects the whitespace run. |
| 150 | */ |
| 151 | function charClass(c: string): 0 | 1 | 2 { |
| 152 | if (c === ' ' || c === '') return 0 |
| 153 | if (WORD_CHAR.test(c)) return 1 |
| 154 | return 2 |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Find the bounds of the same-class character run at (col, row). Returns |