feat(workspaces): make tab-bar tabs workspace-local

This commit is contained in:
Antonio Ruiz 2022-08-31 19:59:03 -04:00 committed by Henrik Lissner
parent aac3c15cde
commit 191745424b
2 changed files with 21 additions and 1 deletions

View file

@ -572,6 +572,20 @@ This be hooked to `projectile-after-switch-project-hook'."
(run-hooks 'projectile-after-switch-project-hook)
(setq +workspaces--project-dir nil)))))
;;;###autoload
(defun +workspaces-save-tab-bar-data-h (_)
"Save the current workspace's tab bar data."
(when (get-current-persp)
(set-persp-parameter
'tab-bar-tabs (tab-bar-tabs))
(set-persp-parameter 'tab-bar-closed-tabs tab-bar-closed-tabs)))
;;;###autoload
(defun +workspaces-load-tab-bar-data-h (_)
"Restores the tab bar data of the workspace we have just switched to."
(tab-bar-tabs-set (persp-parameter 'tab-bar-tabs))
(setq tab-bar-closed-tabs (persp-parameter 'tab-bar-closed-tabs))
(tab-bar--update-tab-bar-lines t))
;;
;;; Advice