(
state: {
type: 'operatorCount'
op: Operator
count: number
digits: string
},
input: string,
ctx: TransitionContext,
)
| 308 | } |
| 309 | |
| 310 | function 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 | |
| 334 | function fromOperatorFind( |
| 335 | state: { |
no test coverage detected