()
| 534 | // But WORD movements see 1 WORD: "hello-world!" |
| 535 | |
| 536 | nextWord(): Cursor { |
| 537 | if (this.isAtEnd()) { |
| 538 | return this |
| 539 | } |
| 540 | |
| 541 | // Use Intl.Segmenter for proper word boundary detection (including CJK) |
| 542 | const wordBoundaries = this.measuredText.getWordBoundaries() |
| 543 | |
| 544 | // Find the next word start boundary after current position |
| 545 | for (const boundary of wordBoundaries) { |
| 546 | if (boundary.isWordLike && boundary.start > this.offset) { |
| 547 | return new Cursor(this.measuredText, boundary.start) |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | // If no next word found, go to end |
| 552 | return new Cursor(this.measuredText, this.text.length) |
| 553 | } |
| 554 | |
| 555 | endOfWord(): Cursor { |
| 556 | if (this.isAtEnd()) { |
no test coverage detected