+workspace/delete: error if workspace doesn't exist
This commit is contained in:
parent
e40a58c423
commit
1ed8894826
1 changed files with 18 additions and 16 deletions
|
@ -301,6 +301,8 @@ workspace to delete."
|
|||
current-name))))
|
||||
(condition-case-unless-debug ex
|
||||
(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"))
|
||||
((> (length workspaces) 1)
|
||||
|
@ -316,7 +318,7 @@ workspace to delete."
|
|||
(unless (string= (car workspaces) +workspaces-main)
|
||||
(+workspace-delete name))
|
||||
(doom/kill-all-buffers)))
|
||||
(+workspace-message (format "Deleted '%s' workspace" name) 'success))
|
||||
(+workspace-message (format "Deleted '%s' workspace" name) 'success)))
|
||||
('error (+workspace-error ex t))))
|
||||
|
||||
;;;###autoload
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue