(state: TextState)
| 3582 | }) |
| 3583 | |
| 3584 | const processTextBackspace = (state: TextState) => { |
| 3585 | if (state.cursor <= 0) { |
| 3586 | return Effect.succeed(Action.Beep()) |
| 3587 | } |
| 3588 | const beforeCursor = state.value.slice(0, state.cursor - 1) |
| 3589 | const afterCursor = state.value.slice(state.cursor) |
| 3590 | const cursor = state.cursor - 1 |
| 3591 | const value = `${beforeCursor}${afterCursor}` |
| 3592 | return Effect.succeed( |
| 3593 | Action.NextFrame({ |
| 3594 | state: { ...state, cursor, value, error: Option.none() } |
| 3595 | }) |
| 3596 | ) |
| 3597 | } |
| 3598 | |
| 3599 | const processTextClear = (state: TextState) => |
| 3600 | Effect.succeed( |
no test coverage detected