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

Function fromOperatorCount

source code/vim/transitions.ts:312–334  ·  view source on GitHub ↗
(
  state: {
    type: 'operatorCount'
    op: Operator
    count: number
    digits: string
  },
  input: string,
  ctx: TransitionContext,
)

Source from the content-addressed store, hash-verified

310}
311
312function fromOperatorCount(
313 state: {
314 type: 'operatorCount'
315 op: Operator
316 count: number
317 digits: string
318 },
319 input: string,
320 ctx: TransitionContext,
321): TransitionResult {
322 if (/[0-9]/.test(input)) {
323 const newDigits = state.digits + input
324 const parsedDigits = Math.min(parseInt(newDigits, 10), MAX_VIM_COUNT)
325 return { next: { ...state, digits: String(parsedDigits) } }
326 }
327
328 const motionCount = parseInt(state.digits, 10)
329 const effectiveCount = state.count * motionCount
330 const result = handleOperatorInput(state.op, effectiveCount, input, ctx)
331 if (result) return result
332
333 return { next: { type: 'idle' } }
334}
335
336function fromOperatorFind(
337 state: {

Callers 1

transitionFunction · 0.85

Calls 1

handleOperatorInputFunction · 0.85

Tested by

no test coverage detected