Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)

Cmd.Internal

Description

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

Synopsis

# Documentation

Record keydowns into the State modifier map.

Keep Cmd.state_focused_view up to date.

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.

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.

This is called after every non-failing cmd.

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.