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