Switch to last workspace after persp-load

A little more intuitive than just switching to main workspace.
This commit is contained in:
Henrik Lissner 2018-06-19 14:52:33 +02:00
parent 5f04be599f
commit 8cb36afa21
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -111,7 +111,10 @@ Uses `+workspaces-main' to determine the name of the main workspace."
(defun +workspaces|leave-nil-perspective (&rest _)
(when (string= (+workspace-current-name) persp-nil-name)
(persp-frame-switch +workspaces-main)))
(+workspace-switch (or (if (+workspace-p +workspace--last) +workspace--last)
(car (+workspace-list-names))
+workspaces-main)
'auto-create)))
(add-hook 'persp-after-load-state-functions #'+workspaces|leave-nil-perspective)
;; Modify `delete-window' to close the workspace if used on the last window