( s: SelectionState, screen: Screen, col: number, row: number, )
| 238 | * selection word-by-word (native macOS behavior). |
| 239 | */ |
| 240 | export function selectWordAt( |
| 241 | s: SelectionState, |
| 242 | screen: Screen, |
| 243 | col: number, |
| 244 | row: number, |
| 245 | ): void { |
| 246 | const b = wordBoundsAt(screen, col, row) |
| 247 | if (!b) return |
| 248 | const lo = { col: b.lo, row } |
| 249 | const hi = { col: b.hi, row } |
| 250 | s.anchor = lo |
| 251 | s.focus = hi |
| 252 | s.isDragging = true |
| 253 | s.anchorSpan = { lo, hi, kind: 'word' } |
| 254 | } |
| 255 | |
| 256 | // Printable ASCII minus terminal URL delimiters. Restricting to single- |
| 257 | // codeunit ASCII keeps cell-count === string-index, so the column-span |
no test coverage detected