MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / nextWord

Method nextWord

source code/utils/Cursor.ts:563–580  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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