()
| 559 | // But WORD movements see 1 WORD: "hello-world!" |
| 560 | |
| 561 | nextWord(): Cursor { |
| 562 | if (this.isAtEnd()) { |
| 563 | return this |
| 564 | } |
| 565 | |
| 566 | // Use Intl.Segmenter for proper word boundary detection (including CJK) |
| 567 | const wordBoundaries = this.measuredText.getWordBoundaries() |
| 568 | |
| 569 | // Find the next word start boundary after current position |
| 570 | for (const boundary of wordBoundaries) { |
| 571 | if (boundary.isWordLike && boundary.start > this.offset) { |
| 572 | return new Cursor(this.measuredText, boundary.start) |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | // If no next word found, go to end |
| 577 | return new Cursor(this.measuredText, this.text.length) |
| 578 | } |
| 579 | |
| 580 | endOfWord(): Cursor { |
| 581 | if (this.isAtEnd()) { |
no test coverage detected