(input: string, ctx: TransitionContext)
| 246 | // ============================================================================ |
| 247 | |
| 248 | function fromIdle(input: string, ctx: TransitionContext): TransitionResult { |
| 249 | // 0 is line-start motion, not a count prefix |
| 250 | if (/[1-9]/.test(input)) { |
| 251 | return { next: { type: 'count', digits: input } } |
| 252 | } |
| 253 | if (input === '0') { |
| 254 | return { |
| 255 | execute: () => ctx.setOffset(ctx.cursor.startOfLogicalLine().offset), |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | const result = handleNormalInput(input, 1, ctx) |
| 260 | if (result) return result |
| 261 | |
| 262 | return {} |
| 263 | } |
| 264 | |
| 265 | function fromCount( |
| 266 | state: { type: 'count'; digits: string }, |
no test coverage detected