Use newline-based alignment technique on dashboard
Fixes #645, because Emacs' mouse events don't appear to compensate for variable-width whitespace.
This commit is contained in:
parent
08a453bd5e
commit
e66abfb9e8
1 changed files with 9 additions and 16 deletions
|
@ -161,22 +161,15 @@ whose dimensions may not be fully initialized by the time this is run."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(with-silent-modifications
|
(with-silent-modifications
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(cond ((display-graphic-p)
|
(delete-region (line-beginning-position)
|
||||||
(delete-region (line-beginning-position) (1+ (line-end-position)))
|
(save-excursion (skip-chars-forward "\n")
|
||||||
(insert (propertize
|
(point)))
|
||||||
(char-to-string ?\uE001)
|
(insert (make-string
|
||||||
'display `((space :align-to 0
|
(max 0 (- (/ (window-height (get-buffer-window)) 2)
|
||||||
:height ,(max 0 (- (/ (window-height (get-buffer-window)) 2)
|
(truncate (/ (count-lines (point-min) (point-max))
|
||||||
(/ (count-lines (point-min) (point-max)) 2.5))))))
|
2))
|
||||||
"\n"))
|
2)) ?\n)
|
||||||
(t
|
"\n")))))))
|
||||||
(while (string-empty-p (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
|
|
||||||
(delete-region (line-beginning-position) (1+ (line-end-position))))
|
|
||||||
(insert
|
|
||||||
"\n"
|
|
||||||
(make-string (max 0 (- (/ (window-height (get-buffer-window)) 2)
|
|
||||||
(/ (count-lines (point-min) (point-max)) 2)))
|
|
||||||
?\n))))))))))
|
|
||||||
|
|
||||||
(defun +doom-dashboard|detect-project (&rest _)
|
(defun +doom-dashboard|detect-project (&rest _)
|
||||||
"Check for a `last-project-root' parameter in the perspective, and set the
|
"Check for a `last-project-root' parameter in the perspective, and set the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue