fix(tabs): error while centaur-tabs-mode is off

The hooks on `+doom-dashboard-mode-hook` and `+popup-buffer-mode-hook`
will throw an error if centaur-tabs-mode is disabled, which may be the
case if the user disables it interactively, post-startup.

Fix #5196
This commit is contained in:
Henrik Lissner 2021-09-26 12:07:35 +02:00
parent 2084eddf5f
commit b1336e18ce

View file

@ -15,8 +15,11 @@
centaur-tabs-cycle-scope 'tabs)
:config
(add-hook '+doom-dashboard-mode-hook #'centaur-tabs-local-mode)
(add-hook '+popup-buffer-mode-hook #'centaur-tabs-local-mode))
(add-hook! '(+doom-dashboard-mode-hook +popup-buffer-mode-hook)
(defun +tabs-disable-centaur-tabs-mode-maybe-h ()
"Disable `centaur-tabs-mode' in current buffer."
(when (centaur-tabs-mode-on-p)
(centaur-tabs-local-mode)))))
;; TODO tab-bar-mode (emacs 27)