MCPcopy
hub / github.com/claude-code-best/claude-code / prevWORD

Method prevWORD

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

Source from the content-addressed store, hash-verified

794 }
795
796 prevWORD(): Cursor {
797 // eslint-disable-next-line @typescript-eslint/no-this-alias
798 let cursor: Cursor = this
799
800 // if we are already at the beginning of a WORD, step off it
801 if (cursor.left().isOverWhitespace()) {
802 cursor = cursor.left()
803 }
804
805 // Move left over any whitespace characters
806 while (cursor.isOverWhitespace() && !cursor.isAtStart()) {
807 cursor = cursor.left()
808 }
809
810 // If we're over a non-whitespace character, move to the start of this WORD
811 if (!cursor.isOverWhitespace()) {
812 while (!cursor.left().isOverWhitespace() && !cursor.isAtStart()) {
813 cursor = cursor.left()
814 }
815 }
816
817 return cursor
818 }
819
820 modifyText(end: Cursor, insertString: string = ''): Cursor {
821 const startOffset = this.offset

Callers 1

applySingleMotionFunction · 0.80

Calls 3

isOverWhitespaceMethod · 0.80
leftMethod · 0.80
isAtStartMethod · 0.80

Tested by

no test coverage detected