MCPcopy
hub / github.com/codeaashu/claude-code / nextWord

Method nextWord

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

Source from the content-addressed store, hash-verified

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

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