Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't rely on evil state when reconciling level
This is a general step towards maintaining a distinct notion of a current mode within Rigpa, which may use the current mode reported by Evil or Lithium as part of its operation. But it also is in response to a bug where [u]ndo'ing while in Symex mode causes the level to be reconciled to the level of Normal in the current tower (e.g. 2), even though we remain in Symex state. This seems to happen because as of emacs-evil/evil#1888, undoing explicitly goes into Normal state first, and then returns to whatever the original state was. In Rigpa, Normal is backed by Evil but Symex is backed by Lithium, even though it sets the Evil state for UI feedback purposes. As a result, we only watch the Evil state transition to reconcile the level when entering Normal state, but not Symex state, since we do not expect the Evil state transition to be the way in which Symex state is entered (it's rather just an effect of Symex mode entry via Lithium). As a result, during the undo operation, we see the transition to Normal and reconcile the level to 2, but do not see the transition back to (evil) Symex state, and thus do not reconcile the level back again to 1. This fix alleviates the bug because even though `rigpa--reconcile-level` is still only called upon Normal state entry, it does not result in the level actually changing because Rigpa's determination of current mode now first checks whether a Lithium mode is active, before checking the evil state. So even though the latter has changed during the undo operation, the mode remains the same as before, as the former has not changed.
- Loading branch information