feat(calendar): only initialize calfw if necessary

If the *calendar* workspace is already populated with calfw buffers,
there is no reason to re-initialize calfw.
This commit is contained in:
Antonio Ruiz 2022-08-31 14:35:59 -04:00 committed by Henrik Lissner
parent 9d14d093c0
commit 31a6fa77d0

View file

@ -18,8 +18,12 @@
(if (modulep! :ui workspaces)
(progn
(+workspace-switch +calendar-workspace-name t)
(unless (memq (buffer-local-value 'major-mode
(window-buffer (selected-window)))
'(cfw:details-mode
cfw:calendar-mode))
(doom/switch-to-scratch-buffer)
(+calendar--init)
(+calendar--init))
(+workspace/display))
(setq +calendar--wconf (current-window-configuration))
(delete-other-windows)