Function: evil-visual-deactivate-hook

evil-visual-deactivate-hook is a byte-compiled function defined in evil-states.el.

Signature

(evil-visual-deactivate-hook &optional COMMAND)

Documentation

Deactivate the region and restore Transient Mark mode.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-states.el
(defun evil-visual-deactivate-hook (&optional command)
  "Deactivate the region and restore Transient Mark mode."
  (setq command (or command this-command))
  (remove-hook 'deactivate-mark-hook
               #'evil-visual-deactivate-hook t)
  (remove-hook 'evil-normal-state-entry-hook
               #'evil-visual-deactivate-hook t)
  (cond
   ((and (evil-visual-state-p) command
         (not (evil-get-command-property command :keep-visual)))
    (setq evil-visual-region-expanded nil)
    (evil-exit-visual-state))
   ((not (evil-visual-state-p))
    (evil-active-region -1)
    (evil-restore-transient-mark-mode))))