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))
|
(+doom-dashboard-mode))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(setq default-directory old-pwd)
|
(setq default-directory old-pwd)
|
||||||
(let ((+doom-dashboard--height (window-height (get-buffer-window fallback-buffer))))
|
(let ((+doom-dashboard--height (window-height (get-buffer-window fallback-buffer)))
|
||||||
(insert (make-string (max 0 (- (truncate (/ +doom-dashboard--height 2)) 16)) ?\n))
|
(lines 1)
|
||||||
|
content)
|
||||||
|
(with-temp-buffer
|
||||||
(dolist (widget-name +doom-dashboard-widgets)
|
(dolist (widget-name +doom-dashboard-widgets)
|
||||||
(funcall (intern (format "doom-dashboard-widget--%s" widget-name)))
|
(funcall (intern (format "doom-dashboard-widget--%s" widget-name)))
|
||||||
(insert "\n")))
|
(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))
|
(unless (button-at (point))
|
||||||
(goto-char (next-button (point-min))))))))
|
(goto-char (next-button (point-min))))))))
|
||||||
;; Update all dashboard windows
|
;; Update all dashboard windows
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue