Fix +workspace/delete changing workspaces

...when deleting other workspaces.
This commit is contained in:
Henrik Lissner 2019-09-29 23:12:43 -04:00
parent fd67534c89
commit 3f7e0fd103
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -243,11 +243,14 @@ workspace to delete."
nil nil nil nil current-name)
current-name))))
(condition-case-unless-debug ex
;; REVIEW refactor me
(let ((workspaces (+workspace-list-names)))
(if (not (member name workspaces))
(+workspace-message (format "'%s' workspace doesn't exist" name) 'warn)
(cond ((delq (selected-frame) (persp-frames-with-persp (get-frame-persp)))
(user-error "Can't close workspace, it's visible in another frame"))
((not (equal (+workspace-current-name) name))
(+workspace-delete name))
((> (length workspaces) 1)
(+workspace-delete name)
(+workspace-switch