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

Function createOperatorContext

src/hooks/useVimInput.ts:82–107  ·  view source on GitHub ↗
(
    cursor: Cursor,
    isReplay: boolean = false,
  )

Source from the content-addressed store, hash-verified

80 }, [onModeChange, textInput, props.value])
81
82 function createOperatorContext(
83 cursor: Cursor,
84 isReplay: boolean = false,
85 ): OperatorContext {
86 return {
87 cursor,
88 text: props.value,
89 setText: (newText: string) => props.onChange(newText),
90 setOffset: (offset: number) => textInput.setOffset(offset),
91 enterInsert: (offset: number) => switchToInsertMode(offset),
92 getRegister: () => persistentRef.current.register,
93 setRegister: (content: string, linewise: boolean) => {
94 persistentRef.current.register = content
95 persistentRef.current.registerIsLinewise = linewise
96 },
97 getLastFind: () => persistentRef.current.lastFind,
98 setLastFind: (type, char) => {
99 persistentRef.current.lastFind = { type, char }
100 },
101 recordChange: isReplay
102 ? () => {}
103 : (change: RecordedChange) => {
104 persistentRef.current.lastChange = change
105 },
106 }
107 }
108
109 function replayLastChange(): void {
110 const change = persistentRef.current.lastChange

Callers 2

replayLastChangeFunction · 0.85
handleVimInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected