( key: string, cursor: Cursor, count: number, )
| 11 | * Does not modify anything - pure calculation. |
| 12 | */ |
| 13 | export function resolveMotion( |
| 14 | key: string, |
| 15 | cursor: Cursor, |
| 16 | count: number, |
| 17 | ): Cursor { |
| 18 | let result = cursor |
| 19 | for (let i = 0; i < count; i++) { |
| 20 | const next = applySingleMotion(key, result) |
| 21 | if (next.equals(result)) break |
| 22 | result = next |
| 23 | } |
| 24 | return result |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Apply a single motion step. |
no test coverage detected