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

Function fromOperatorCount

src/vim/transitions.ts:310–332  ·  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

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

Callers 1

transitionFunction · 0.85

Calls 1

handleOperatorInputFunction · 0.85

Tested by

no test coverage detected