(state: TextState)
| 3846 | }) |
| 3847 | |
| 3848 | const processTextBackspace = (state: TextState) => { |
| 3849 | if (state.cursor <= 0) { |
| 3850 | return Effect.succeed(Action.Beep()) |
| 3851 | } |
| 3852 | const beforeCursor = state.value.slice(0, state.cursor - 1) |
| 3853 | const afterCursor = state.value.slice(state.cursor) |
| 3854 | const cursor = state.cursor - 1 |
| 3855 | const value = `${beforeCursor}${afterCursor}` |
| 3856 | return Effect.succeed( |
| 3857 | Action.NextFrame({ |
| 3858 | state: { ...state, cursor, value, error: Option.none() } |
| 3859 | }) |
| 3860 | ) |
| 3861 | } |
| 3862 | |
| 3863 | const processTextClear = (state: TextState) => |
| 3864 | Effect.succeed( |
no test coverage detected