Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Cmd.Internal

Description

Internal Cmds, that keep bits of Cmd.State up to date that everyone else relies on.

Synopsis

Documentation

cmd_record_keys :: Cmd.M m => Msg.Msg -> m Cmd.Status Source #

Record keydowns into the State modifier map.

cmd_record_ui_updates :: Cmd.M m => Msg.Msg -> m Cmd.Status Source #

Catch UiMsg.Msgs from the UI, and modify the state accordingly to reflect the UI state.

Unlike all the other Cmds, the state changes this makes are not synced. UiUpdates report changes that have already occurred directly on the UI, so syncing them would be redundant.

update_ui_state :: Cmd.M m => Msg.Msg -> m Cmd.Status Source #

This is the other half of cmd_record_ui_updates, whose output is synced like normal Cmds. When its a block update I have to update the other views.

sync_status :: Ui.State -> Cmd.State -> Update.UiDamage -> Cmd.CmdId Cmd.Status Source #

This is called after every non-failing cmd.

can_checkpoint Source #

Arguments

:: Cmd.State 
-> Maybe.Maybe (Path.Canonical, GitT.Commit)

I need both a repo and a previous commit to checkpoint.

Return Just if there will be a git checkpoint. update_saved has to predict this because by the time save_history runs, it's too late to make Ui.State changes.

This is not defined in Cmd.Undo to avoid a circular import.