MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / nextWord

Method nextWord

src/utils/Cursor.ts:536–553  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()) {

Callers 4

deleteWordAfterMethod · 0.95
handleKeyDownFunction · 0.80
useTextInputFunction · 0.80
mapKeyFunction · 0.80

Calls 2

isAtEndMethod · 0.95
getWordBoundariesMethod · 0.80

Tested by

no test coverage detected