Function: treemacs-leftclick-action
treemacs-leftclick-action is an autoloaded, interactive and
byte-compiled function defined in treemacs-mouse-interface.el.
Signature
(treemacs-leftclick-action EVENT)
Documentation
Move focus to the clicked line.
Must be bound to a mouse click, or EVENT will not be supplied.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-mouse-interface.el
;;;###autoload
(defun treemacs-leftclick-action (event)
"Move focus to the clicked line.
Must be bound to a mouse click, or EVENT will not be supplied."
(interactive "e")
(when (eq 'down-mouse-1 (elt event 0))
(select-window (->> event (cadr) (nth 0)))
(goto-char (posn-point (cadr event)))
(when (region-active-p)
(keyboard-quit))
;; 7th element is the clicked image
(when (->> event (cadr) (nth 7))
(treemacs-do-for-button-state
:on-file-node-closed (treemacs--expand-file-node btn)
:on-file-node-open (treemacs--collapse-file-node btn)
:on-tag-node-closed (treemacs--expand-tag-node btn)
:on-tag-node-open (treemacs--collapse-tag-node btn)
:no-error t))
(treemacs--evade-image)))