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

Method endOfWORD

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

Source from the content-addressed store, hash-verified

786 }
787
788 endOfWORD(): Cursor {
789 if (this.isAtEnd()) {
790 return this
791 }
792
793 // eslint-disable-next-line @typescript-eslint/no-this-alias
794 let cursor: Cursor = this
795
796 // Check if we're already at the end of a WORD
797 // (current character is non-whitespace, but next character is whitespace or we're at the end)
798 const atEndOfWORD =
799 !cursor.isOverWhitespace() &&
800 (cursor.right().isOverWhitespace() || cursor.right().isAtEnd())
801
802 if (atEndOfWORD) {
803 // We're already at the end of a WORD, move to the next WORD
804 cursor = cursor.right()
805 return cursor.endOfWORD()
806 }
807
808 // If we're on a whitespace character, find the next WORD
809 if (cursor.isOverWhitespace()) {
810 cursor = cursor.nextWORD()
811 }
812
813 // Now move to the end of the current WORD
814 while (!cursor.right().isOverWhitespace() && !cursor.isAtEnd()) {
815 cursor = cursor.right()
816 }
817
818 return cursor
819 }
820
821 prevWORD(): Cursor {
822 // eslint-disable-next-line @typescript-eslint/no-this-alias

Callers 2

getOperatorRangeFunction · 0.80
applySingleMotionFunction · 0.80

Calls 4

isAtEndMethod · 0.95
isOverWhitespaceMethod · 0.80
rightMethod · 0.80
nextWORDMethod · 0.80

Tested by

no test coverage detected