Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always undo in normal state #1888

Merged

Conversation

tomdl89
Copy link
Member

@tomdl89 tomdl89 commented Apr 15, 2024

Fixes #1883

@tomdl89 tomdl89 merged commit eae05b5 into emacs-evil:master Apr 15, 2024
6 checks passed
countvajhula added a commit to countvajhula/rigpa that referenced this pull request Sep 13, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

evil-redo won't redo evil-undo, unless the latter was called in "normal mode"
1 participant