MCPcopy Index your code
hub / github.com/codeaashu/claude-code / nextVimWord

Method nextVimWord

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

Source from the content-addressed store, hash-verified

656 // 2. A sequence of non-blank, non-word characters (punctuation/symbols)
657
658 nextVimWord(): Cursor {
659 if (this.isAtEnd()) {
660 return this
661 }
662
663 let pos = this.offset
664 const advance = (p: number): number => this.measuredText.nextOffset(p)
665
666 const currentGrapheme = this.graphemeAt(pos)
667 if (!currentGrapheme) {
668 return this
669 }
670
671 if (isVimWordChar(currentGrapheme)) {
672 while (pos < this.text.length && isVimWordChar(this.graphemeAt(pos))) {
673 pos = advance(pos)
674 }
675 } else if (isVimPunctuation(currentGrapheme)) {
676 while (pos < this.text.length && isVimPunctuation(this.graphemeAt(pos))) {
677 pos = advance(pos)
678 }
679 }
680
681 while (
682 pos < this.text.length &&
683 WHITESPACE_REGEX.test(this.graphemeAt(pos))
684 ) {
685 pos = advance(pos)
686 }
687
688 return new Cursor(this.measuredText, pos)
689 }
690
691 endOfVimWord(): Cursor {
692 if (this.isAtEnd()) {

Callers 2

getOperatorRangeFunction · 0.80
applySingleMotionFunction · 0.80

Calls 5

isAtEndMethod · 0.95
graphemeAtMethod · 0.95
isVimWordCharFunction · 0.85
advanceFunction · 0.85
isVimPunctuationFunction · 0.85

Tested by

no test coverage detected