Skip to content

Commit

Permalink
Rely on lithium instead of evil for exit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
countvajhula committed Sep 18, 2024
1 parent 3c08c7e commit 2bc4bb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion symex-lithium.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"Symex state."
:tag " <λ> "
:message "-- SYMEX --"
:exit-hook (symex-exit-mode)
:enable (normal))

(defun symex-evil-repeat-start-recording-advice (&rest _)
Expand Down
15 changes: 7 additions & 8 deletions symex-misc.el
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,13 @@ ORIG-FN applied to ARGS is the invocation being advised."

(defun symex-exit-mode ()
"Take necessary action upon symex mode exit."
(unless (member evil-next-state '(emacslike normallike))
;; these are "internal" state transitions, used in e.g. symex-evaluate
(deactivate-mark)
(when symex--original-blink-cursor-state
(blink-cursor-mode 1))
(when symex-refocus-p
(symex--restore-scroll-margin))
(symex--primitive-exit)))
;; these are "internal" state transitions, used in e.g. symex-evaluate
(deactivate-mark)
(when symex--original-blink-cursor-state
(blink-cursor-mode 1))
(when symex-refocus-p
(symex--restore-scroll-margin))
(symex--primitive-exit))

(provide 'symex-misc)
;;; symex-misc.el ends here
3 changes: 2 additions & 1 deletion symex.el
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@

(defun symex-modal-provider-initialize ()
"Initialize the modal interface provider."
(symex-lithium-initialize))
(symex-lithium-initialize)
(add-hook 'symex-editing-mode-pre-exit-hook #'symex-exit-mode))

;;;###autoload
(defun symex-initialize ()
Expand Down

0 comments on commit 2bc4bb3

Please sign in to comment.