Function: dirvish--maybe-toggle-cursor

dirvish--maybe-toggle-cursor is a natively compiled function defined in dirvish.el.

Signature

(dirvish--maybe-toggle-cursor &optional CURSOR)

Documentation

Toggle cursor's invisibility according to context.

Optionally, use CURSOR as the enabled cursor type.

Source Code

;; Defined in /nix/store/1gijwny2yx4fggrsb9l110h1ybs1gdk5-emacs-packages-deps/share/emacs/site-lisp/elpa/dirvish-20260725.1520/dirvish.el
(defun dirvish--maybe-toggle-cursor (&optional cursor)
  "Toggle cursor's invisibility according to context.
Optionally, use CURSOR as the enabled cursor type."
  (if (dirvish--apply-hiding-p dirvish-hide-cursor)
      (prog1 (setq-local cursor-type nil)
        (cond ((bound-and-true-p evil-local-mode)
               (setq-local evil-normal-state-cursor '(bar . 0)))
              ((bound-and-true-p meow-motion-mode)
               (setq-local meow-cursor-type-motion nil))))
    (setq-local cursor-type (or cursor '(box . 4)))
    (cond ((bound-and-true-p evil-local-mode)
           (setq-local evil-normal-state-cursor (or cursor '(box . 4))))
          ((bound-and-true-p meow-motion-mode)
           (setq-local meow-cursor-type-motion (or cursor '(box . 4)))))))