Function: treemacs--set-width

treemacs--set-width is a byte-compiled function defined in treemacs-core-utils.el.

Signature

(treemacs--set-width WIDTH)

Documentation

Set the width of the treemacs buffer to WIDTH.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-core-utils.el
(defun treemacs--set-width (width)
  "Set the width of the treemacs buffer to WIDTH."
  (unless (one-window-p)
    (let ((window-size-fixed)
          (w (max width window-safe-min-width)))
      (cond
       ((> (window-width) w)
        (shrink-window-horizontally  (- (window-width) w)))
       ((< (window-width) w)
        (enlarge-window-horizontally (- w (window-width))))))))