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

Function findTextObject

source code/vim/textObjects.ts:40–60  ·  view source on GitHub ↗
(
  text: string,
  offset: number,
  objectType: string,
  isInner: boolean,
)

Source from the content-addressed store, hash-verified

38 * Find a text object at the given position.
39 */
40export function findTextObject(
41 text: string,
42 offset: number,
43 objectType: string,
44 isInner: boolean,
45): TextObjectRange {
46 if (objectType === 'w')
47 return findWordObject(text, offset, isInner, isVimWordChar)
48 if (objectType === 'W')
49 return findWordObject(text, offset, isInner, ch => !isVimWhitespace(ch))
50
51 const pair = PAIRS[objectType]
52 if (pair) {
53 const [open, close] = pair
54 return open === close
55 ? findQuoteObject(text, offset, open, isInner)
56 : findBracketObject(text, offset, open, close, isInner)
57 }
58
59 return null
60}
61
62function findWordObject(
63 text: string,

Callers 1

executeOperatorTextObjFunction · 0.85

Calls 4

findWordObjectFunction · 0.85
isVimWhitespaceFunction · 0.85
findQuoteObjectFunction · 0.85
findBracketObjectFunction · 0.85

Tested by

no test coverage detected