mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
ui/doom-dashboard: add deferred reload for new frames
This commit is contained in:
@ -42,6 +42,7 @@
|
|||||||
(setq doom-fallback-buffer +doom-dashboard-name)
|
(setq doom-fallback-buffer +doom-dashboard-name)
|
||||||
|
|
||||||
(add-hook 'emacs-startup-hook '+doom-dashboard/open)
|
(add-hook 'emacs-startup-hook '+doom-dashboard/open)
|
||||||
|
(add-hook 'after-make-frame-functions '+doom-dashboard-deferred-reload)
|
||||||
(add-hook! 'kill-buffer-query-functions
|
(add-hook! 'kill-buffer-query-functions
|
||||||
(if (not (+doom-dashboard-p))
|
(if (not (+doom-dashboard-p))
|
||||||
t
|
t
|
||||||
@ -84,6 +85,11 @@
|
|||||||
(setq fringe-indicator-alist +doom-dashboard--old-fringe-indicator)
|
(setq fringe-indicator-alist +doom-dashboard--old-fringe-indicator)
|
||||||
(remove-hook 'evil-insert-state-entry-hook 'doom|mode-erase-on-insert t)))
|
(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)
|
(defun +doom-dashboard-reload (&optional dir)
|
||||||
"Update the DOOM scratch buffer (or create it, if it doesn't exist)."
|
"Update the DOOM scratch buffer (or create it, if it doesn't exist)."
|
||||||
(when (and (not +doom-dashboard-inhibit-refresh)
|
(when (and (not +doom-dashboard-inhibit-refresh)
|
||||||
|
Reference in New Issue
Block a user