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

Method prevWORD

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

Source from the content-addressed store, hash-verified

819 }
820
821 prevWORD(): Cursor {
822 // eslint-disable-next-line @typescript-eslint/no-this-alias
823 let cursor: Cursor = this
824
825 // if we are already at the beginning of a WORD, step off it
826 if (cursor.left().isOverWhitespace()) {
827 cursor = cursor.left()
828 }
829
830 // Move left over any whitespace characters
831 while (cursor.isOverWhitespace() && !cursor.isAtStart()) {
832 cursor = cursor.left()
833 }
834
835 // If we're over a non-whitespace character, move to the start of this WORD
836 if (!cursor.isOverWhitespace()) {
837 while (!cursor.left().isOverWhitespace() && !cursor.isAtStart()) {
838 cursor = cursor.left()
839 }
840 }
841
842 return cursor
843 }
844
845 modifyText(end: Cursor, insertString: string = ''): Cursor {
846 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