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

Function createOperatorContext

source code/hooks/useVimInput.ts:84–109  ·  view source on GitHub ↗
(
    cursor: Cursor,
    isReplay: boolean = false,
  )

Source from the content-addressed store, hash-verified

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

Callers 2

replayLastChangeFunction · 0.85
handleVimInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected