Optimize +workspace-new & workspace creation
This is much faster than the old method of switching to the persp to modify them.
This commit is contained in:
parent
d7e4901bda
commit
e40a58c423
1 changed files with 7 additions and 3 deletions
|
@ -155,7 +155,13 @@ Otherwise return t on success, nil otherwise."
|
||||||
(error "Can't create a new '%s' workspace" name))
|
(error "Can't create a new '%s' workspace" name))
|
||||||
(when (+workspace-exists-p name)
|
(when (+workspace-exists-p name)
|
||||||
(error "A workspace named '%s' already exists" name))
|
(error "A workspace named '%s' already exists" name))
|
||||||
(persp-add-new name))
|
(let ((persp (persp-add-new name))
|
||||||
|
(+popup--inhibit-transient t))
|
||||||
|
(save-window-excursion
|
||||||
|
(delete-other-windows)
|
||||||
|
(switch-to-buffer (doom-fallback-buffer))
|
||||||
|
(setf (persp-window-conf persp)
|
||||||
|
(funcall persp-window-state-get-function (selected-frame))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +workspace-rename (name new-name)
|
(defun +workspace-rename (name new-name)
|
||||||
|
@ -342,8 +348,6 @@ workspace, otherwise the new workspace is blank."
|
||||||
(clone-p (persp-copy name t))
|
(clone-p (persp-copy name t))
|
||||||
(t
|
(t
|
||||||
(+workspace-switch name t)
|
(+workspace-switch name t)
|
||||||
(persp-delete-other-windows)
|
|
||||||
(switch-to-buffer (doom-fallback-buffer))
|
|
||||||
(+workspace/display)))
|
(+workspace/display)))
|
||||||
((debug error) (+workspace-error (cadr e) t))))
|
((debug error) (+workspace-error (cadr e) t))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue