ui/doom-dashboard: add deferred reload for new frames

This commit is contained in:
Henrik Lissner 2017-02-24 03:13:23 -05:00
parent 4d20872b35
commit ede6553959

View file

@ -42,6 +42,7 @@
(setq doom-fallback-buffer +doom-dashboard-name)
(add-hook 'emacs-startup-hook '+doom-dashboard/open)
(add-hook 'after-make-frame-functions '+doom-dashboard-deferred-reload)
(add-hook! 'kill-buffer-query-functions
(if (not (+doom-dashboard-p))
t
@ -84,6 +85,11 @@
(setq fringe-indicator-alist +doom-dashboard--old-fringe-indicator)
(remove-hook 'evil-insert-state-entry-hook 'doom|mode-erase-on-insert t)))
(defun +doom-dashboard-deferred-reload (&rest _)
"Reload the dashboard after a brief pause. This is necessary for new frames,
whose dimensions may not be fully initialized by the time this is run."
(run-with-timer 0.1 nil '+doom-dashboard-reload))
(defun +doom-dashboard-reload (&optional dir)
"Update the DOOM scratch buffer (or create it, if it doesn't exist)."
(when (and (not +doom-dashboard-inhibit-refresh)