Function: evil-visual-post-command
evil-visual-post-command is a byte-compiled function defined in
evil-states.el.
Signature
(evil-visual-post-command &optional COMMAND)
Documentation
Run after each COMMAND in Visual state.
If COMMAND is a motion, refresh the selection; otherwise exit Visual state.
Source Code
;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-states.el
(defun evil-visual-post-command (&optional command)
"Run after each COMMAND in Visual state.
If COMMAND is a motion, refresh the selection;
otherwise exit Visual state."
(when (evil-visual-state-p)
(setq command (or command this-command))
(if (or quit-flag
(memq command '(keyboard-quit keyboard-escape-quit))
;; Is `mark-active' nil for an unexpanded region?
deactivate-mark
(and (not evil-visual-region-expanded)
(not (region-active-p))
(not (eq evil-visual-selection 'block))
transient-mark-mode))
(progn
(evil-exit-visual-state)
(evil-adjust-cursor))
(if evil-visual-region-expanded
(evil-visual-contract-region)
(evil-visual-refresh))
(setq evil-visual-x-select-timer
(run-with-idle-timer evil-visual-x-select-timeout nil
#'evil-visual-update-x-selection
(current-buffer)))
(evil-visual-highlight))))