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

Function findTextObject

src/vim/textObjects.ts:38–58  ·  view source on GitHub ↗
(
  text: string,
  offset: number,
  objectType: string,
  isInner: boolean,
)

Source from the content-addressed store, hash-verified

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