MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / handleOperatorInput

Function handleOperatorInput

src/vim/transitions.ts:206–242  ·  view source on GitHub ↗

* Handle operator input (motion, find, text object scope). * Returns null if input is not recognized.

(
  op: Operator,
  count: number,
  input: string,
  ctx: TransitionContext,
)

Source from the content-addressed store, hash-verified

204 * Returns null if input is not recognized.
205 */
206function handleOperatorInput(
207 op: Operator,
208 count: number,
209 input: string,
210 ctx: TransitionContext,
211): TransitionResult | null {
212 if (isTextObjScopeKey(input)) {
213 return {
214 next: {
215 type: 'operatorTextObj',
216 op,
217 count,
218 scope: TEXT_OBJ_SCOPES[input],
219 },
220 }
221 }
222
223 if (FIND_KEYS.has(input)) {
224 return {
225 next: { type: 'operatorFind', op, count, find: input as FindType },
226 }
227 }
228
229 if (SIMPLE_MOTIONS.has(input)) {
230 return { execute: () => executeOperatorMotion(op, input, count, ctx) }
231 }
232
233 if (input === 'G') {
234 return { execute: () => executeOperatorG(op, count, ctx) }
235 }
236
237 if (input === 'g') {
238 return { next: { type: 'operatorG', op, count } }
239 }
240
241 return null
242}
243
244// ============================================================================
245// Transition Functions - One per state type

Callers 2

fromOperatorFunction · 0.85
fromOperatorCountFunction · 0.85

Calls 4

isTextObjScopeKeyFunction · 0.85
executeOperatorMotionFunction · 0.85
executeOperatorGFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected