Skip to content

Commit

Permalink
refactor(tabspaces): better check
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jun 21, 2023
1 parent 16db93a commit 985b1f3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/me-workspaces.el
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@
(advice-add
'tabspaces-switch-or-create-workspace :around
(defun +tabspaces--switch-to-scratch-after-create-a (origfn &rest workspace)
(let ((length-before (length (tabspaces--list-tabspaces))))
(let ((before-list (tabspaces--list-tabspaces)))
(apply origfn workspace)
(when (length> (tabspaces--list-tabspaces) length-before)
(switch-to-buffer (get-scratch-buffer-create))))))
;; Created a new empty workspace
(when-let ((new-ws (cl-set-difference (tabspaces--list-tabspaces) before-list :test #'string=)))
(+scratch-open-buffer nil nil 'same-window)))))

(tabspaces-mode 1)

Expand Down

0 comments on commit 985b1f3

Please sign in to comment.