Function: treemacs-next-workspace
treemacs-next-workspace is an interactive and byte-compiled function
defined in treemacs-interface.el.
Signature
(treemacs-next-workspace &optional ARG)
Documentation
Switch to the next workspace.
With a prefix ARG switch to the previous workspace instead.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-interface.el
(defun treemacs-next-workspace (&optional arg)
"Switch to the next workspace.
With a prefix ARG switch to the previous workspace instead."
(interactive)
(treemacs-block
(treemacs-error-return-if (= 1 (length treemacs--workspaces))
"There is only 1 workspace.")
(let* ((ws (treemacs-current-workspace))
(ws-count (length treemacs--workspaces))
(idx (--find-index (eq it ws) treemacs--workspaces))
(new-idx (% (+ ws-count (if arg (1- idx) (1+ idx))) ws-count))
(new-ws (nth new-idx treemacs--workspaces)))
(treemacs-do-switch-workspace new-ws)
(treemacs-pulse-on-success "Switched to workspace '%s'"
(propertize (treemacs-workspace->name new-ws)
'face 'font-lock-string-face)))))