Dynamic vertical alignment of the dashboard #192
This commit is contained in:
parent
27b1d08c19
commit
6259ba9114
1 changed files with 13 additions and 5 deletions
|
@ -116,11 +116,19 @@ whose dimensions may not be fully initialized by the time this is run."
|
|||
(+doom-dashboard-mode))
|
||||
(erase-buffer)
|
||||
(setq default-directory old-pwd)
|
||||
(let ((+doom-dashboard--height (window-height (get-buffer-window fallback-buffer))))
|
||||
(insert (make-string (max 0 (- (truncate (/ +doom-dashboard--height 2)) 16)) ?\n))
|
||||
(dolist (widget-name +doom-dashboard-widgets)
|
||||
(funcall (intern (format "doom-dashboard-widget--%s" widget-name)))
|
||||
(insert "\n")))
|
||||
(let ((+doom-dashboard--height (window-height (get-buffer-window fallback-buffer)))
|
||||
(lines 1)
|
||||
content)
|
||||
(with-temp-buffer
|
||||
(dolist (widget-name +doom-dashboard-widgets)
|
||||
(funcall (intern (format "doom-dashboard-widget--%s" widget-name)))
|
||||
(insert "\n"))
|
||||
(setq content (buffer-string)
|
||||
lines (count-lines (point-min) (point-max))))
|
||||
(insert (make-string (max 0 (- (/ +doom-dashboard--height 2)
|
||||
(/ lines 2)))
|
||||
?\n)
|
||||
content))
|
||||
(unless (button-at (point))
|
||||
(goto-char (next-button (point-min))))))))
|
||||
;; Update all dashboard windows
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue